|
BeBOP Optimized Sparse Kernel Interface Library
1.0.1h
|
Implements a routine to transpose a CSR matrix. More...
#include <oski/config.h>#include <oski/common.h>#include <oski/matrix.h>#include <oski/CSR/format.h>#include <oski/CSR/module.h>Functions | |
| static void | cumulative_sum (const oski_index_t *x, oski_index_t n, oski_index_t *y) |
Given an array of values, this routine computes the cumulative sum , where . | |
| static int | TransposeFullCSR (const oski_index_t *ptr, const oski_index_t *ind, const oski_value_t *val, oski_index_t m, oski_index_t n, oski_index_t base, oski_index_t **p_Tptr, oski_index_t **p_Tind, oski_value_t **p_Tval) |
Transpose a full-storage matrix stored in CSR matrix (or equivalently, convert from CSR to CSC). | |
| static void | ConjOffDiagElems (const oski_index_t *ptr, const oski_index_t *ind, oski_value_t *val, oski_index_t m, oski_index_t b) |
| Conjugate all off-diagonal elements of a CSR representation. | |
| oski_matCSR_t * | oski_TransposeCSR (const oski_matCSR_t *A, const oski_matcommon_t *props) |
Given a matrix in CSR format, returns a copy of its explicit transpose in CSR format. | |
Implements a routine to transpose a CSR matrix.
| static void ConjOffDiagElems | ( | const oski_index_t * | ptr, |
| const oski_index_t * | ind, | ||
| oski_value_t * | val, | ||
| oski_index_t | m, | ||
| oski_index_t | b | ||
| ) | [static] |
Conjugate all off-diagonal elements of a CSR representation.
References VAL_CONJ.
Referenced by oski_TransposeCSR().
| static void cumulative_sum | ( | const oski_index_t * | x, |
| oski_index_t | n, | ||
| oski_index_t * | y | ||
| ) | [static] |
Given an array
of
values, this routine computes the cumulative sum
, where
.
| [in] | x | Array of values to sum. |
| [in] | n | Length of . |
| [in,out] | y | An array of size used to store the cumulative sum. |
Referenced by TransposeFullCSR().
| oski_matCSR_t* oski_TransposeCSR | ( | const oski_matCSR_t * | A, |
| const oski_matcommon_t * | props | ||
| ) |
Given a matrix
in CSR format, returns a copy of its explicit transpose
in CSR format.
| [in] | A | Matrix to transpose. |
| [in] | props | Common properties of . |
, or NULL on memory error.This implementation maintains symmetric/Hermitian properties if they apply to
.
References oski_matCSR_t::base_index, ConjOffDiagElems(), ERR_OUT_OF_MEMORY, oski_matCSR_t::ind, oski_matcommon_t::is_herm, oski_matCSR_t::is_shared, oski_matcommon_t::is_symm, oski_matcommon_t::num_cols, oski_matcommon_t::num_rows, oski_CopyMem, OSKI_ERR, oski_Free, oski_Malloc, oski_matcommon_t::pattern, oski_matCSR_t::ptr, TransposeFullCSR(), and oski_matCSR_t::val.
| static int TransposeFullCSR | ( | const oski_index_t * | ptr, |
| const oski_index_t * | ind, | ||
| const oski_value_t * | val, | ||
| oski_index_t | m, | ||
| oski_index_t | n, | ||
| oski_index_t | base, | ||
| oski_index_t ** | p_Tptr, | ||
| oski_index_t ** | p_Tind, | ||
| oski_value_t ** | p_Tval | ||
| ) | [static] |
Transpose a full-storage
matrix
stored in CSR matrix (or equivalently, convert from CSR to CSC).
| [in] | ptr | Row pointers. |
| [in] | ind | Column indices. |
| [in] | val | Non-zero values, or NULL if the caller only wishes to transpose the pattern. |
| [in] | m | Number of rows. |
| [in] | n | Number of columns. |
| [in] | base | Index base used for ptr, ind. |
| [out] | p_Tptr | *p_Tptr stores the row pointers of . |
| [out] | p_Tind | *p_Tind stores the column indices of . |
| [out] | p_Tval | *p_Tval stores the non-zero values of . |
References cumulative_sum(), ERR_OUT_OF_MEMORY, ERR_WRONG_ANS, MACRO_TO_STRING, oski_Free, oski_FreeAll(), oski_HandleError, oski_Malloc, oski_MultiMalloc(), and VAL_ASSIGN.
Referenced by oski_TransposeCSR().
1.7.6.1