Macaulay2 Engine
Loading...
Searching...
No Matches

◆ get_norm_start()

gmp_RRmutable get_norm_start ( gmp_RR p,
const Ring * R )
static

Definition at line 1137 of file mutable-matrix.cpp.

1138{
1139 if (R->get_precision() == 0)
1140 {
1141 ERROR("expected ring over an RR or CC");
1142 return nullptr;
1143 }
1145 mpfr_init2(norm, mpfr_get_prec(p));
1146 mpfr_ui_div(norm, 1, p, MPFR_RNDN);
1147 if (!mpfr_zero_p(norm))
1148 {
1149 ERROR("Lp norm only implemented for p = infinity");
1150 mpfr_clear(norm);
1151 return nullptr;
1152 }
1153 return norm;
1154}
virtual unsigned long get_precision() const
Definition ring.cpp:438
int p
const int ERROR
Definition m2-mem.cpp:55
#define getmemstructtype(S)
Definition m2-mem.h:143
mpfr_ptr gmp_RRmutable
Definition m2-types.h:150

References ERROR, Ring::get_precision(), getmemstructtype, and p.

Referenced by rawRingElementNorm().