Package org.djunits.vecmat.operations
Interface Normed<Q extends Quantity<Q,U>,U extends UnitInterface<U,Q>>
- Type Parameters:
Q- the quantity typeU- the unit type
- All Known Implementing Classes:
Vector,Vector1,Vector2,Vector2.Col,Vector2.Row,Vector3,Vector3.Col,Vector3.Row,VectorN,VectorN.Col,VectorN.Row
public interface Normed<Q extends Quantity<Q,U>,U extends UnitInterface<U,Q>>
Normed calculates a norm of an element, expressed as a quantity.
Copyright (c) 2025-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.
- Author:
- Alexander Verbraeck
-
Method Summary
Modifier and TypeMethodDescriptiondefault Qnorm()Return the norm of this element, expressed as a quantity.normL1()Return the L1-norm of this element, expressed as a quantity.normL2()Return the L2-norm of this element, expressed as a quantity.normLinf()Return the L∞-norm of this element, expressed as a quantity.normLp(int p) Return the Lp-norm of this element, expressed as a quantity.
-
Method Details
-
norm
Return the norm of this element, expressed as a quantity. The standard norm is the L2-norm.- Returns:
- the norm of this element, expressed as a quantity
-
normL1
Q normL1()Return the L1-norm of this element, expressed as a quantity. The L1-norm is |x1| + |x2| + ... + |xn|.- Returns:
- the L1-norm of this element, expressed as a quantity
-
normL2
Q normL2()Return the L2-norm of this element, expressed as a quantity. The L2-norm is sqrt(x1^2 + x2^2 + ... + xn^2).- Returns:
- the L2-norm of this element, expressed as a quantity
-
normLp
Return the Lp-norm of this element, expressed as a quantity. The Ln-norm is (x1^p + x2^p + ... + xn^p)^(1/p).- Parameters:
p- the rank of the norm- Returns:
- the Lp-norm of this element, expressed as a quantity
-
normLinf
Q normLinf()Return the L∞-norm of this element, expressed as a quantity. The L∞-norm is max(|x1|, |x2|, ..., |xn|).- Returns:
- the L∞-norm of this element, expressed as a quantity
-