DGtal  0.9.3
Functions
testLinearAlgebra.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/kernel/SpaceND.h"
#include "DGtal/kernel/LinearAlgebra.h"
Include dependency graph for testLinearAlgebra.cpp:

Go to the source code of this file.

Functions

bool testLinearAlgebra ()
 
int main (int argc, char **argv)
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
David Coeurjolly (david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@l.nosp@m.iris..nosp@m.cnrs.nosp@m..fr ) Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2010/12/14

Functions for testing class LinearAlgebra.

This file is part of the DGtal library.

Definition in file testLinearAlgebra.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 77 of file testLinearAlgebra.cpp.

References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testLinearAlgebra(), and DGtal::trace.

78 {
79  trace.beginBlock ( "Testing class LinearAlgebra" );
80  trace.info() << "Args:";
81  for ( int i = 0; i < argc; ++i )
82  trace.info() << " " << argv[ i ];
83  trace.info() << endl;
84 
85  bool res = testLinearAlgebra(); // && ... other tests
86  trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
87  trace.endBlock();
88  return res ? 0 : 1;
89 }
void beginBlock(const std::string &keyword="")
bool testLinearAlgebra()
Trace trace
Definition: Common.h:137
double endBlock()
std::ostream & emphase()
std::ostream & info()

◆ testLinearAlgebra()

bool testLinearAlgebra ( )

Example of a test. To be completed.

Definition at line 47 of file testLinearAlgebra.cpp.

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), and DGtal::trace.

Referenced by main().

48 {
49  unsigned int nbok = 0;
50  unsigned int nb = 0;
51 
52  trace.beginBlock ( "Testing block ..." );
53 
54  typedef SpaceND<2,DGtal::int32_t> Space2Int;
55  typedef Space2Int::Point Point;
56  typedef SpaceND<2,DGtal::int64_t > Space2LongInt;
57  typedef Space2LongInt::Point Pointlong;
58 
59  Point a,b;
60  Pointlong c,d;
61 
64 
65  nbok += true ? 1 : 0;
66  nb++;
67  trace.info() << "(" << nbok << "/" << nb << ") "
68  << "true == true" << std::endl;
69  trace.endBlock();
70 
71  return nbok == nb;
72 }
void beginBlock(const std::string &keyword="")
Aim: A utility class that contains methods to perform integral linear algebra.
Definition: LinearAlgebra.h:61
Trace trace
Definition: Common.h:137
Aim: SpaceND is a utility class that defines the fundamental structure of a Digital Space in ND...
Definition: SpaceND.h:95
double endBlock()
MyPointD Point
Definition: testClone2.cpp:383
std::ostream & info()