source: tol/tolsh/tests/matprod/seqtest.tol @ 6d7779d

1941-docker-image-to-testdevel
Last change on this file since 6d7779d was 6d7779d, checked in by Jorge Pérez <josp.jorge@…>, 18 years ago

initial import

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[6d7779d]1/* -*- mode: c++ -*- */
2
3/*
4   ----------------------------------------------------------------------
5                 Version secuencial del producto de matrices
6   ---------------------------------------------------------------------- 
7 */
8
9Set Include("config.tol");
10Set Include("utils.tol");
11Set Include("data.tol");
12
13Matrix RunSequential(Matrix A, Matrix B)
14{
15  Matrix C = Do A*B
16};
17
18Matrix MeasureSequential(Matrix A, Matrix B, Real iters)
19{
20  Set tm = StartTimer("MeasureSequential : " << iters << " iterations");
21
22  Real k=1;
23
24  Real While(k<=iters-1;
25    {
26      Matrix RunSequential(A,B);
27      Real k:=k+1
28    });
29
30  Matrix C = RunSequential(A,B);
31
32  Real elapsed = FinishTimer(tm);
33 
34  Matrix timeData = Rand(1, 2, 0, 0);
35  Real Do PutMatDat(timeData, 1, 1, Rows(C));
36  Real Do PutMatDat(timeData, 1, 2, elapsed);
37  Matrix MatAppendFile("seqtime.bbm", timeData);
38
39  Matrix C
40};
41
42/* Leo los datos*/
43Set data = ReadData(paramTest);
44
45/* Ejecuto version secuencial */
46Matrix seqC = MeasureSequential(data[1],data[2],1);
47
48/* */
49Matrix MatWriteFile("seqC.bbm", seqC);
Note: See TracBrowser for help on using the repository browser.