ergo
csr_matrix.cc File Reference

Compressed sparse row (CSR) matrix functionality. More...

#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <cassert>
#include <stdexcept>
#include "csr_matrix.h"
#include "output.h"
#include "memorymanag.h"
#include "mat_gblas.h"

Classes

struct  csr_index_pair_struct
 

Functions

static int csr_compare_index_pairs_for_qsort (const void *p1, const void *p2)
 
int ergo_CSR_create (csr_matrix_struct *csr, int symmetryFlag, int n, long nnz, const std::vector< int > &rowind, const std::vector< int > &colind)
 
int ergo_CSR_destroy (csr_matrix_struct *csr)
 
int ergo_CSR_copy (csr_matrix_struct *csrDest, const csr_matrix_struct *csrSource)
 
int ergo_CSR_add_equal_structure (csr_matrix_struct *csrDest, const csr_matrix_struct *csrSource)
 
static long ergo_csr_find_index (const csr_matrix_struct *csr, int row, int col)
 
int ergo_CSR_add_to_element (csr_matrix_struct *csr, int row, int col, ergo_real value)
 
ergo_real ergo_CSR_get_element (const csr_matrix_struct *csr, int row, int col)
 
ergo_real ergo_CSR_get_max_abs_element (const csr_matrix_struct *csr)
 
long ergo_CSR_get_nvalues (const csr_matrix_struct *csr)
 
int ergo_CSR_get_values (const csr_matrix_struct *csr, std::vector< int > &rowind, std::vector< int > &colind, std::vector< ergo_real > &values, long nvalues)
 
int ergo_CSR_get_nvalues_singlerow (const csr_matrix_struct *csr, int row)
 
int ergo_CSR_get_values_singlerow (const csr_matrix_struct *csr, int row, std::vector< int > &colind, std::vector< ergo_real > &values, int nvalues)
 

Detailed Description

Compressed sparse row (CSR) matrix functionality.

Author
: Elias Rudberg responsible

Function Documentation

◆ csr_compare_index_pairs_for_qsort()

static int csr_compare_index_pairs_for_qsort ( const void *  p1,
const void *  p2 
)
static

◆ ergo_CSR_add_equal_structure()

◆ ergo_CSR_add_to_element()

◆ ergo_CSR_copy()

◆ ergo_CSR_create()

◆ ergo_CSR_destroy()

◆ ergo_csr_find_index()

◆ ergo_CSR_get_element()

◆ ergo_CSR_get_max_abs_element()

ergo_real ergo_CSR_get_max_abs_element ( const csr_matrix_struct csr)

◆ ergo_CSR_get_nvalues()

long ergo_CSR_get_nvalues ( const csr_matrix_struct csr)

◆ ergo_CSR_get_nvalues_singlerow()

int ergo_CSR_get_nvalues_singlerow ( const csr_matrix_struct csr,
int  row 
)

◆ ergo_CSR_get_values()

◆ ergo_CSR_get_values_singlerow()

int ergo_CSR_get_values_singlerow ( const csr_matrix_struct csr,
int  row,
std::vector< int > &  colind,
std::vector< ergo_real > &  values,
int  nvalues 
)