Prev Next sparse_mat_info

@(@\newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\W}[1]{ \; #1 \; }@)@This is cppad_mixed--20220519 documentation: Here is a link to its current documentation .
Sparse Matrix Information

Syntax
Purpose
row
     K
col
val
resize
Notation
     Sparsity Pattern
     Sparse Matrix
     Empty Matrix
     Column Major Order
     Row Major Order
     Lower Triangular

Syntax
CppAD::mixed::sparse_mat_info mat_info
mat_info.resize(size)

Purpose
This structure holds information about a sparse matrix.

row
The field mat_info.row has prototype
     CppAD::vector<size_t> 
mat_info.row
It has size zero when it is constructed. After initialization it should contain the row indices corresponding to possibly non-zero elements of the matrix.

K
We use K = mat_info.row.size() below.

col
The field mat_info.col has prototype
     CppAD::vector<size_t> 
mat_info.col
It has size zero when it is constructed. After initialization it should have the same size as row and contain the column indices corresponding to possibly non-zero elements of the matrix.

val
The field mat_info.val has prototype
     CppAD::vector<double> 
mat_info.val
It has size zero when it is constructed. After initialization it should either have size zero, or the same size as row .

resize
The resize argument has prototype
     size_t 
size
All of the vectors, row , col , and val , are modified to have the specified size.

Notation

Sparsity Pattern
We say that mat_info is a sparsity pattern if, for k = 0 , ... , K-1 , the element with index
     (
mat_info.row[k], mat_info.col[k])
is possibly non-zero and the size or elements of mat_info.val are not specified.

Sparse Matrix
We say that mat_info is a sparse matrix if, for k = 0 , ... , K-1 , the element with index
     (
mat_info.row[k], mat_info.col[k])
is possibly non-zero and has value mat_info.val[k] .

Empty Matrix
If K is zero ( mat_info.row.size() is zero), we say that mat_info is the empty matrix.

Column Major Order
If for k = 0 , ... , K-1 ,
     
mat_info.col[k] <= mat_info.col[k+1]
     if( 
mat_info.col[k] == mat_info.col[k+1] )
          
mat_info.row[k] < mat_info.row[k+1]
we say that mat_info is in column major order.

Row Major Order
If for k = 0 , ... , K-1 ,
     
mat_info.row[k] <= mat_info.row[k+1]
     if( 
mat_info.row[k] == mat_info.row[k+1] )
          
mat_info.col[k] < mat_info.col[k+1]
we say that mat_info is in row major order.

Lower Triangular
If for k = 0 , ... , K-1 ,
     
mat_info.row[k] >= mat_info.col[k]
we say that mat_info is lower triangular.
Input File: include/cppad/mixed/sparse_mat_info.hpp