Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/numeric/ublas/doc/samples/matrix.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 988 bytes
Line 
1//
2//  Copyright (c) 2000-2002
3//  Joerg Walter, Mathias Koch
4//
5//  Permission to use, copy, modify, distribute and sell this software
6//  and its documentation for any purpose is hereby granted without fee,
7//  provided that the above copyright notice appear in all copies and
8//  that both that copyright notice and this permission notice appear
9//  in supporting documentation.  The authors make no representations
10//  about the suitability of this software for any purpose.
11//  It is provided "as is" without express or implied warranty.
12//
13//  The authors gratefully acknowledge the support of
14//  GeNeSys mbH & Co. KG in producing this work.
15//
16
17#include <boost/numeric/ublas/matrix.hpp>
18#include <boost/numeric/ublas/io.hpp>
19
20int main () {
21    using namespace boost::numeric::ublas;
22    matrix<double> m (3, 3);
23    for (unsigned i = 0; i < m.size1 (); ++ i)
24        for (unsigned j = 0; j < m.size2 (); ++ j)
25            m (i, j) = 3 * i + j;
26    std::cout << m << std::endl;
27}
28
Note: See TracBrowser for help on using the repository browser.