Show
Ignore:
Timestamp:
08/05/09 14:40:03 (15 years ago)
Author:
mido
Message:

panove, vite, jak jsem peclivej na upravu kodu.. snad se vam bude libit:) konfigurace je v souboru /system/astylerc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/tutorial/src/vector_and_matrix.cpp

    r278 r477  
    77using std::endl; 
    88 
    9 int main() 
    10 { 
    11   //Declare vectors and matricies: 
    12   vec a, b, c; 
    13   mat A, B; 
     9int main() { 
     10        //Declare vectors and matricies: 
     11        vec a, b, c; 
     12        mat A, B; 
    1413 
    15   //Use the function linspace to define a vector: 
    16   a = linspace(1.0, 2.0, 10); 
     14        //Use the function linspace to define a vector: 
     15        a = linspace ( 1.0, 2.0, 10 ); 
    1716 
    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"; 
     17        //Use a string of values to define a vector: 
     18        b = "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0"; 
    2019 
    21   //Add two vectors: 
    22   c = a + b; 
     20        //Add two vectors: 
     21        c = a + b; 
    2322 
    24   //Print results: 
    25   cout << "a = " << a << endl; 
    26   cout << "b = " << b << endl; 
    27   cout << "c = " << c << endl; 
     23        //Print results: 
     24        cout << "a = " << a << endl; 
     25        cout << "b = " << b << endl; 
     26        cout << "c = " << c << endl; 
    2827 
    29   //Use a string to define a matrix: 
    30   A = "1.0 2.0;3.0 4.0"; 
     28        //Use a string to define a matrix: 
     29        A = "1.0 2.0;3.0 4.0"; 
    3130 
    32   //Calculate the inverse of matrix A: 
    33   B = inv(A); 
     31        //Calculate the inverse of matrix A: 
     32        B = inv ( A ); 
    3433 
    35   //Print results: 
    36   cout << "A = " << A << endl; 
    37   cout << "B = " << B << endl; 
     34        //Print results: 
     35        cout << "A = " << A << endl; 
     36        cout << "B = " << B << endl; 
    3837 
    39   //Exit program: 
    40   return 0; 
     38        //Exit program: 
     39        return 0; 
    4140 
    4241}