Package org.networkcalculus.dnc.curves
Interface LinearSegment
-
- All Known Implementing Classes:
LinearSegment_Disco
,LinearSegment_MPARTC
public interface LinearSegment
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
LinearSegment.Builder
-
Method Summary
Modifier and Type Method Description static LinearSegment
add(LinearSegment s1, LinearSegment s2, Num x, boolean leftopen)
Helper creating a new segment starting at x that is the sum of the given getSegment.LinearSegment
copy()
static LinearSegment
createHorizontalLine(double y)
static LinearSegment
createLinearSegment(Num x, Num y, Num grad, boolean leftopen)
boolean
equals(java.lang.Object obj)
Num
f(Num x)
Num
getGrad()
Num
getX()
Num
getXIntersectionWith(LinearSegment other)
Num
getY()
int
hashCode()
boolean
isLeftopen()
static LinearSegment
max(LinearSegment s1, LinearSegment s2, Num x, boolean leftopen, boolean crossed)
Helper creating a new segment starting at x that is the maximum of the given segments.static LinearSegment
min(LinearSegment s1, LinearSegment s2, Num x, boolean leftopen, boolean crossed)
Helper creating a new segment starting at x that is the minimum of the given getSegment.void
setGrad(Num grad)
void
setLeftopen(boolean leftopen)
void
setX(Num x)
void
setY(Num y)
static LinearSegment
sub(LinearSegment s1, LinearSegment s2, Num x, boolean leftopen)
Helper creating a new segment starting at x that is the difference between the given getSegment.java.lang.String
toString()
-
-
-
Method Detail
-
createLinearSegment
static LinearSegment createLinearSegment(Num x, Num y, Num grad, boolean leftopen)
-
createHorizontalLine
static LinearSegment createHorizontalLine(double y)
-
add
static LinearSegment add(LinearSegment s1, LinearSegment s2, Num x, boolean leftopen)
Helper creating a new segment starting at x that is the sum of the given getSegment.- Parameters:
s1
- Segment 1.s2
- Segment 2.x
- New x-coordinate the start at.leftopen
- Set the segment to be left-open.- Returns:
- The new linear segment, pointwise sum of the given ones, starting in x.
-
sub
static LinearSegment sub(LinearSegment s1, LinearSegment s2, Num x, boolean leftopen)
Helper creating a new segment starting at x that is the difference between the given getSegment.- Parameters:
s1
- Segment 1.s2
- Segment 2.x
- New x-coordinate the start at.leftopen
- Set the segment to be left-open.- Returns:
- The new linear segment, pointwise difference of the given ones, i.e., s1 - s2, starting in x.
-
min
static LinearSegment min(LinearSegment s1, LinearSegment s2, Num x, boolean leftopen, boolean crossed)
Helper creating a new segment starting at x that is the minimum of the given getSegment. Note: Only valid if s1 and s2 do not intersect before the next IP.- Parameters:
s1
- Segment 1.s2
- Segment 2.x
- New x-coordinate the start at.leftopen
- Set the segment to be left-open.crossed
- Provides information if the segments intersect.- Returns:
- The new linear segment, pointwise minimum of the given ones, starting in x.
-
max
static LinearSegment max(LinearSegment s1, LinearSegment s2, Num x, boolean leftopen, boolean crossed)
Helper creating a new segment starting at x that is the maximum of the given segments. Note: Only valid if s1 and s2 do not intersect before the next IP.- Parameters:
s1
- Segment 1.s2
- Segment 2.x
- New x-coordinate the start at.leftopen
- Set the segment to be left-open.crossed
- Provides information if the segments intersect.- Returns:
- The new linear segment, pointwise maximum of the given ones, starting in x.
-
getX
Num getX()
-
setX
void setX(Num x)
-
getY
Num getY()
-
setY
void setY(Num y)
-
getGrad
Num getGrad()
-
setGrad
void setGrad(Num grad)
-
isLeftopen
boolean isLeftopen()
-
setLeftopen
void setLeftopen(boolean leftopen)
-
getXIntersectionWith
Num getXIntersectionWith(LinearSegment other)
-
copy
LinearSegment copy()
-
equals
boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-