Changeset 2

Show
Ignore:
Timestamp:
01/17/08 17:18:16 (16 years ago)
Author:
smidl
Message:

first shot

Files:
3 added
2 modified

Legend:

Unmodified
Added
Removed
  • Makefile

    r1 r2  
    88 
    99 
    10 test0: test0.cpp lib0.o lib0a.o 
     10test0: test0.cpp libBM.o libDC.o 
    1111 
  • test0.cpp

    r1 r2  
    11#include <itpp/itbase.h> 
     2#include "libBM.h" 
    23 
    34using namespace itpp; 
     
    910int main() 
    1011{ 
    11   //Declare vectors and matricies: 
    12   vec a, b, c; 
    13   mat A, B; 
    1412 
    15   //Use the function linspace to define a vector: 
    16   a = linspace(1.0,2.0,10); 
     13  RV th = RV("1 2","{a b }","1 1","0 0","0 0"); 
    1714 
    18   //Use a string of values to define a vector: 
    19   b = "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0"; 
    20  
    21   //Add two vectors: 
    22   c = a + b; 
    23  
    24   //Print results: 
    25   cout << "a = " << a << endl; 
    26   cout << "b = " << b << endl; 
    27   cout << "c = " << c << endl; 
    28  
    29   //Use a string to define a matrix: 
    30   A = "1.0 2.0;3.0 4.0"; 
    31  
    32   //Calculate the inverse of matrix A: 
    33   B = inv(A); 
    34  
    35   //Print results: 
    36   cout << "A = " << A << endl; 
    37   cout << "B = " << B << endl; 
     15  cout << th << th << endl; 
    3816 
    3917  //Exit program: