GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
tril.cc File Reference
#include <algorithm>
#include "Array.h"
#include "Sparse.h"
#include "mx-base.h"
#include "ov.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "ovl.h"
Include dependency graph for tril.cc:

Go to the source code of this file.

Macros

#define ARRAYCASE(TYP)
 

Functions

template<typename T >
static Array< T > do_tril (const Array< T > &a, octave_idx_type k, bool pack)
 
template<typename T >
static Sparse< T > do_tril (const Sparse< T > &a, octave_idx_type k, bool pack)
 
template<typename T >
static Array< T > do_trilu (const Array< T > &a, octave_idx_type k, bool lower, bool pack)
 
template<typename T >
static Sparse< T > do_trilu (const Sparse< T > &a, octave_idx_type k, bool lower, bool pack)
 
static octave_value do_trilu (const std::string &name, const octave_value_list &args)
 
template<typename T >
static Array< T > do_triu (const Array< T > &a, octave_idx_type k, bool pack)
 
template<typename T >
static Sparse< T > do_triu (const Sparse< T > &a, octave_idx_type k, bool pack)
 
OCTAVE_EXPORT octave_value_list Ftril (const octave_value_list &args, int) and setting all other elements to zero. The optional second argument specifies how many diagonals above or below the main diagonal should also be set to zero. The default value of ar
 

Variables

is zero which includes the main diagonal as part of the result If the value of but instead stacked column wise one above another
 
is zero which includes the main diagonal as part of the result If the value of ar {k} is a nonzero integer then the selection of elements starts at an offset of ar{k} diagonals above the main diagonal for positive ar{k} or below the main diagonal for negative ar{k}. The absolute value of ar{k} may not be greater than the number of subdiagonals or superdiagonals. Example 1 : exclude main diagonal xample roup tril (ones (3), -1) esult{} 0 0 0 1 0 0 1 1 0 nd group nd example oindent Example 2 : include first superdiagonal xample roup tril (ones (3), 1) esult{} 1 1 0 1 1 1 1 1 1 nd group nd example If the optional third argument code{"pack"} is given then the extracted elements are not inserted into a matrix
 

Macro Definition Documentation

◆ ARRAYCASE

#define ARRAYCASE (   TYP)
Value:
case btyp_ ## TYP: \
retval = do_trilu (arg.TYP ## _array_value (), k, lower, pack); \
break
for large enough k
Definition: lu.cc:617
octave_value arg
Definition: pr-output.cc:3244
static Array< T > do_trilu(const Array< T > &a, octave_idx_type k, bool lower, bool pack)
Definition: tril.cc:171

Referenced by do_trilu().

Function Documentation

◆ do_tril() [1/2]

template<typename T >
static Array<T> do_tril ( const Array< T > &  a,
octave_idx_type  k,
bool  pack 
)
static

Definition at line 43 of file tril.cc.

References a, Array< T >::fortran_vec(), k, max(), min(), and zero().

Referenced by do_trilu().

◆ do_tril() [2/2]

template<typename T >
static Sparse<T> do_tril ( const Sparse< T > &  a,
octave_idx_type  k,
bool  pack 
)
static

◆ do_trilu() [1/3]

template<typename T >
static Array<T> do_trilu ( const Array< T > &  a,
octave_idx_type  k,
bool  lower,
bool  pack 
)
static

Definition at line 171 of file tril.cc.

References a, do_tril(), do_triu(), and k.

Referenced by do_trilu(), and Ftril().

◆ do_trilu() [2/3]

template<typename T >
static Sparse<T> do_trilu ( const Sparse< T > &  a,
octave_idx_type  k,
bool  lower,
bool  pack 
)
static

Definition at line 178 of file tril.cc.

References a, do_tril(), do_triu(), and k.

◆ do_trilu() [3/3]

◆ do_triu() [1/2]

template<typename T >
static Array<T> do_triu ( const Array< T > &  a,
octave_idx_type  k,
bool  pack 
)
static

Definition at line 85 of file tril.cc.

References a, Array< T >::fortran_vec(), k, max(), min(), and zero().

Referenced by do_trilu().

◆ do_triu() [2/2]

template<typename T >
static Sparse<T> do_triu ( const Sparse< T > &  a,
octave_idx_type  k,
bool  pack 
)
static

◆ Ftril()

OCTAVE_EXPORT octave_value_list Ftril ( const octave_value_list args,
int   
)

Definition at line 374 of file tril.cc.

References do_trilu().

Referenced by F__ichol0__(), F__icholt__(), and F__ilu0__().

Variable Documentation

◆ another

is zero which includes the main diagonal as part of the result If the value of but instead stacked column wise one above another

Definition at line 374 of file tril.cc.

◆ ar

is zero which includes the main diagonal as part of the result If the value of ar {k} is a nonzero integer then the selection of elements starts at an offset of ar{k} diagonals above the main diagonal for positive ar{k} or below the main diagonal for negative ar{k}. The absolute value of ar{k} may not be greater than the number of subdiagonals or superdiagonals. Example 1 : exclude main diagonal xample roup tril (ones (3), -1) esult{} 0 0 0 1 0 0 1 1 0 nd group nd example oindent Example 2 : include first superdiagonal xample roup tril (ones (3), 1) esult{} 1 1 0 1 1 1 1 1 1 nd group nd example If the optional third argument code{"pack"} is given then the extracted elements are not inserted into a matrix

Definition at line 374 of file tril.cc.