← Indietro
EsameEsame completoTesto d’esame

14 06 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: 14-06-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 (14 points) A tensor is a data container which can store data inN dimensions. You have to develop a class implementing tensors up toN = 3 dimensions fordoubles. You have three main goals: i) your implementation should optimize the worst case complexity, ii) you need to supportrandom access, iii) your data structure will besparse. Considering that any index starts from 0, you have to: 1. implement the constructor which receives as input parameter the dimensions of yourTensorclass 2. provide the definition of the method: void set(double value, unsigned i, int j=-1, int k= -1) k has default value -1 to denote the scenarios where the tensor has one or two dimensions, while j de- fault value -1 characterizes one dimensional tensors. This method will add (for an unseen index) or update (in case the index already exists) values in your tensor objects. 3. implement the method: double get(unsigned i, int j=-1, int k= -1)const k has default value -1 to…

Anteprima

Prima pagina del documento.

Prima pagina: 14 06 2022 E TS