← Indietro
EsameEsame completoTesto d’esame

08 09 2022 E TS

Esame completo di Algorithms and parallel computing per il corso di Mathematical Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Algorithms and parallel computingEsame completo

Informazioni sul documento

Cosa trovi in questo materiale

Esame completo di Algorithms and parallel computing per il corso di Mathematical Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Qualità dell’importazione: il testo è stato estratto direttamente dal documento originale.

Contenuti estratti dal documento

Passaggi rappresentativi riconosciuti nelle diverse parti del materiale. Il testo completo resta presente nella pagina per la ricerca, mentre l’anteprima compatta rende più semplice la lettura.

Pagina 1

Algorithms and Parallel Computing Course 052496 Prof. Danilo Ardagna Date: 08-09-2022 Last Name: ............................................................. First Name: ............................................................. Student ID: ............................................................. Signature: ............................................................... Exam duration: 2 hours and 15 minutes Students can use a pen or a pencil for answering questions. Students are NOT permitted to use books, course notes, calculators, mobile phones, and similar connected devices. Students are NOT permitted to copy anyone else’s answers, pass notes amongst themselves, or engage in other forms of misconduct at any time during the exam. Writing on the cheat sheet is NOT allowed. Exercise 1: Exercise 2: Exercise 3: Exercise 1 (12 points) You have to implement a class to support matrices which allow alternatively access to their elements in row or column-major ordering. From WikepediA, row-major order and column-major order are methods for storing multidimensional arrays in linear storage. The difference between the orders lies in which elements of an array are accessed one after another. In row-major order, the consecutive elements of a row reside next to each other, whereas the same holds true for consecutive elements of a column in column-major order. As an example, according to the following code: Matrix m1 ("col-major",2,3, {0,1,2,3,4,5}); Matrix m2 ("row-major",2,3,{6,7,8,9,10,11}); cout << "m1" << endl; m1.print(); cout << std::endl; cout << "m2" << endl; m2.print(); m2.switch_ordering(); cout << "m2 after switch_ordering()" << endl; m2.print(); m2.switch_ordering(); cout << "m2 after switch_ordering()" << endl; m2.print(); you get the following output: 1 m1 0…

Anteprima

Prima pagina del documento.

Prima pagina: 08 09 2022 E TS