AbstractLinAlgPack_SparseCOOReadMatrix.hpp File Reference

#include <istream>
#include <valarray>
#include "AbstractLinAlgPack_Types.hpp"

Include dependency graph for AbstractLinAlgPack_SparseCOOReadMatrix.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  AbstractLinAlgPack

Functions

void read_coo_into_valarrays (std::istream &istrm, size_type &m, size_type &n, size_type &nz, std::valarray< value_type > &a, std::valarray< indice_type > &ivect, std::valarray< indice_type > &jvect)
 Read in a Coordinate Matrix from a C++ input stream and store it in valarrays.


Function Documentation

void AbstractLinAlgPack::read_coo_into_valarrays std::istream &  istrm,
size_type m,
size_type n,
size_type nz,
std::valarray< value_type > &  a,
std::valarray< indice_type > &  ivect,
std::valarray< indice_type > &  jvect
 

Read in a Coordinate Matrix from a C++ input stream and store it in valarrays.

The format for the imput is:

#m n nz#\ #a1:i1:j1 a2:i2:j2 .... anz:inz:jnz#\

In the above format, each non-zero element is given as a three item pair: value of the non-zero element, row indice (1-based) of the non-zero element, and the column indice (1-based) of the non-zero element. There must be no spaces between the numbers and the \':\' charachter and there must be at least one whitespace character between elements.

The vectors a#, ivect#, and jvect# are resized to nz#. If any problem is found in the input an InputException will be throw that will include a descriptive message about the error.

Parameters:
m number of rows of the sparse matrix
n number of columns of sparse matrix
nz number of non-zero elements of the sparse matrix
a vector holding the non-zero elements
ivect vector holding the row indices (1-based)
jvect vector holding the column indices (1-based)

Definition at line 45 of file AbstractLinAlgPack_SparseCOOReadMatrix.cpp.


Generated on Thu Sep 18 12:35:29 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1