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

Method Normalize

SRC/matrix/Vector.cpp:234–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234int
235Vector::Normalize(void)
236{
237 double length = 0.0;
238 for (int i=0; i<sz; i++)
239 length += theData[i] * theData[i];
240 length = sqrt(length);
241
242 if (length == 0.0)
243 return -1;
244
245 length = 1.0/length;
246 for (int j=0; j<sz; j++)
247 theData[j] *= length;
248
249 return 0;
250}
251
252int
253Vector::addVector(double thisFact, const Vector &other, double otherFact )

Callers 15

GetStabMethod · 0.45
GetStabMethod · 0.45
Brick8FiberOverlayMethod · 0.45
setDomainMethod · 0.45
recvSelfMethod · 0.45
Quad4FiberOverlayMethod · 0.45
recvSelfMethod · 0.45
calculateForcesMethod · 0.45
ASDShellT3Method · 0.45
ASDShellQ4Method · 0.45
getTheta0Method · 0.45
setDomainMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected