MCPcopy Create free account
hub / github.com/numpy/numpy / init_potrf

Function init_potrf

numpy/linalg/umath_linalg.cpp:1900–1926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1898
1899template<typename ftyp>
1900static inline int
1901init_potrf(POTR_PARAMS_t<ftyp> *params, char UPLO, fortran_int N)
1902{
1903 npy_uint8 *mem_buff = NULL;
1904 npy_uint8 *a;
1905 size_t safe_N = N;
1906 fortran_int lda = fortran_int_max(N, 1);
1907
1908 mem_buff = (npy_uint8 *)malloc(safe_N * safe_N * sizeof(ftyp));
1909 if (!mem_buff) {
1910 goto error;
1911 }
1912
1913 a = mem_buff;
1914
1915 params->A = (ftyp*)a;
1916 params->N = N;
1917 params->LDA = lda;
1918 params->UPLO = UPLO;
1919
1920 return 1;
1921 error:
1922 free(mem_buff);
1923 memset(params, 0, sizeof(*params));
1924
1925 return 0;
1926}
1927
1928template<typename ftyp>
1929static inline void

Callers 1

choleskyFunction · 0.85

Calls 1

fortran_int_maxFunction · 0.85

Tested by

no test coverage detected