MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / pNorm

Method pNorm

SRC/matrix/Vector.cpp:619–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619double
620Vector::pNorm(int p) const
621{
622 double value = 0;
623
624 if (p>0) {
625 for (int i=0; i<sz; i++) {
626 double data = fabs(theData[i]);
627 value += pow(data,p);
628 }
629 return pow(value,1.0/p);
630 } else {
631 for (int i=0; i<sz; i++) {
632 double data = fabs(theData[i]);
633 value = (data>value) ? data : value;
634 }
635 return value;
636 }
637}
638
639
640double &

Callers 15

testMethod · 0.45
testMethod · 0.45
testMethod · 0.45
startMethod · 0.45
testMethod · 0.45
testMethod · 0.45
testMethod · 0.45
testMethod · 0.45
testMethod · 0.45
testMethod · 0.45
testMethod · 0.45
testMethod · 0.45

Calls

no outgoing calls

Tested by 10

testMethod · 0.36
testMethod · 0.36
testMethod · 0.36
startMethod · 0.36
testMethod · 0.36
testMethod · 0.36
testMethod · 0.36
testMethod · 0.36
testMethod · 0.36
testMethod · 0.36