.. java:import:: fr.inria.tapenade.representation SymbolTableConstants .. java:import:: fr.inria.tapenade.representation TapEnv BoolVector ========== .. java:package:: fr.inria.tapenade.utils :noindex: .. java:type:: public class BoolVector A vector of booleans, indexed by an integer rank from 0 up. Fields ------ B_SET_ALL ^^^^^^^^^ .. java:field:: protected static final int B_SET_ALL :outertype: BoolVector B_SET_ONE ^^^^^^^^^ .. java:field:: protected static final int B_SET_ONE :outertype: BoolVector B_SET_SIZE ^^^^^^^^^^ .. java:field:: protected static final short B_SET_SIZE :outertype: BoolVector B_SET_ZERO ^^^^^^^^^^ .. java:field:: protected static final int B_SET_ZERO :outertype: BoolVector bSets ^^^^^ .. java:field:: protected int[] bSets :outertype: BoolVector Bitset version of this Boolvector's contents. Array of int's that contain the booleans (32 each). Constructors ------------ BoolVector ^^^^^^^^^^ .. java:constructor:: public BoolVector(int size) :outertype: BoolVector Creates a new BoolVector containing "size" booleans. Each boolean is initialized to false. BoolVector ^^^^^^^^^^ .. java:constructor:: public BoolVector(boolean sparse, int size) :outertype: BoolVector Creates a new BoolVector containing "size" booleans. Each boolean is initialized to false. Methods ------- and ^^^ .. java:method:: public final BoolVector and(BoolVector other) :outertype: BoolVector :return: a new BoolVector containing logical AND between this BoolVector and the "other". contains ^^^^^^^^ .. java:method:: public final boolean contains(TapIntList indices) :outertype: BoolVector :return: true if for each index in "indices" this BoolVector holds the value "true". contains ^^^^^^^^ .. java:method:: public final boolean contains(BoolVector other, int len) :outertype: BoolVector :param other: The other BoolVector that must be contained in this. :param len: The number of booleans on which the test is restricted. :return: true if this BoolVector contains (or is equal to) the "other" BoolVector, considering only the "len" first bits. Same semantics as: this.and(other).equals(other,len) copy ^^^^ .. java:method:: public final BoolVector copy() :outertype: BoolVector Creates a new copy of this BoolVector. copy ^^^^ .. java:method:: public final BoolVector copy(int len, int finalLen) :outertype: BoolVector Same as copy(), but creates a Boolvector of length "finalLen", and copies only the "len" first bits. If finalLen is relatively smaller, truncates. If finalLen is relatively larger, pads with 0's. cumulAnd ^^^^^^^^ .. java:method:: public final void cumulAnd(BoolVector other) :outertype: BoolVector And-accumulates BoolVector "other" into this BoolVector. cumulAnd ^^^^^^^^ .. java:method:: public final void cumulAnd(BoolVector other, int len) :outertype: BoolVector Same as cumulAnd(BoolVector), but only for the "len" first bits. cumulMinus ^^^^^^^^^^ .. java:method:: public final void cumulMinus(BoolVector other) :outertype: BoolVector And-accumulates the negation of BoolVector "other" into this BoolVector. In other words: "this"="this" AND NOT "other". cumulMinus ^^^^^^^^^^ .. java:method:: public final void cumulMinus(BoolVector other, int len) :outertype: BoolVector Same as cumulMinus(BoolVector), but only for the "len" first bits. cumulOr ^^^^^^^ .. java:method:: public final void cumulOr(BoolVector other) :outertype: BoolVector Or-accumulates BoolVector "other" into this BoolVector. cumulOr ^^^^^^^ .. java:method:: public final void cumulOr(BoolVector other, int len) :outertype: BoolVector Same as cumulOr(BoolVector), but only for the "len" first bits. cumulOr ^^^^^^^ .. java:method:: public final void cumulOr(BoolVector newVect, int newStart, int start, int len) :outertype: BoolVector Or-accumulates "len" bits of BoolVector "newVect", starting at bit "newStart", into this BoolVector, starting at bit "start". cumulOrGrows ^^^^^^^^^^^^ .. java:method:: public final boolean cumulOrGrows(BoolVector other) :outertype: BoolVector Or-accumulates BoolVector "other" into this BoolVector. :return: true iff the accumulated BoolVector has more "true" elements. cumulOrGrows ^^^^^^^^^^^^ .. java:method:: public final boolean cumulOrGrows(BoolVector other, int len) :outertype: BoolVector Or-accumulates BoolVector "other" into this BoolVector. Same as cumulOr(BoolVector), but only for the "len" first bits, and returns true iff the accumulated BoolVector has more "true" elements, again considering only the "len" first bits. distance ^^^^^^^^ .. java:method:: public final int distance(BoolVector other, int len) :outertype: BoolVector :param other: The other BoolVector :param len: The number of booleans on which the test is restricted. :return: The number of differences. dump ^^^^ .. java:method:: public void dump() throws java.io.IOException :outertype: BoolVector Prints in detail the contents of this BoolVector, onto TapEnv.curOutputStream(). dump ^^^^ .. java:method:: public void dump(int length) throws java.io.IOException :outertype: BoolVector Prints in detail the contents of this BoolVector, knowing its exact length, onto TapEnv.curOutputStream(). :param length: the exact length of this BoolVector. dump ^^^^ .. java:method:: public void dump(int[] map) throws java.io.IOException :outertype: BoolVector Prints in detail the contents of this BoolVector, knowing its Map, onto TapEnv.curOutputStream(). :param map: the map of this BoolVector. equals ^^^^^^ .. java:method:: public final boolean equals(BoolVector other, int len) :outertype: BoolVector :param other: The other BoolVector that must be equal to this. :param len: The number of booleans on which the test is restricted. :return: true if this is equal to "other". get ^^^ .. java:method:: public final boolean get(int rank) :outertype: BoolVector :return: the boolean value at rank "rank". getSubInt ^^^^^^^^^ .. java:method:: protected static int getSubInt(int origInt, int fromBit, int toBit) :outertype: BoolVector :return: in the leftmost bits of the result a copy of the bits [fromBit;toBit[ of the given int origInt. fromBit and toBit-1 are between 0 and bSetSize-1 (e.g. 31). The remaining bits of the result are set to 0. grossLength ^^^^^^^^^^^ .. java:method:: public int grossLength() :outertype: BoolVector intersects ^^^^^^^^^^ .. java:method:: public final boolean intersects(TapIntList indices) :outertype: BoolVector :return: true if there exists one index in "indices" for which this BoolVector holds the value "true". intersects ^^^^^^^^^^ .. java:method:: public final boolean intersects(BoolVector other, int len) :outertype: BoolVector :param other: The other BoolVector that must intersect this. :param len: The number of booleans on which the test is restricted. :return: true if this intersects "other". isFalse ^^^^^^^ .. java:method:: public final boolean isFalse(int len) :outertype: BoolVector :param len: The number of booleans on which the test is restricted. :return: true if this is full of 0. isSparse ^^^^^^^^ .. java:method:: public final boolean isSparse() :outertype: BoolVector maxTrueRank ^^^^^^^^^^^ .. java:method:: public final int maxTrueRank(int len) :outertype: BoolVector minus ^^^^^ .. java:method:: public final BoolVector minus(BoolVector other) :outertype: BoolVector :return: a new BoolVector containing logical MINUS (i.e. AND NOT) between this BoolVector and the other. not ^^^ .. java:method:: public final BoolVector not() :outertype: BoolVector :return: a new BoolVector containing logical NOT of this BoolVector. numberOfOnes ^^^^^^^^^^^^ .. java:method:: public final int numberOfOnes(int length) :outertype: BoolVector (for debugging) @return the number of "true" elements in this vector. or ^^ .. java:method:: public final BoolVector or(BoolVector other) :outertype: BoolVector :return: a new BoolVector containing logical OR between this BoolVector and the "other". set ^^^ .. java:method:: public final void set(int rank, boolean val) :outertype: BoolVector Sets the boolean value at rank "rank" to "val". set ^^^ .. java:method:: public final void set(TapIntList indexes, boolean val) :outertype: BoolVector Sets all indexes in "indexes" to boolean "val". setCopy ^^^^^^^ .. java:method:: public final void setCopy(BoolVector model) :outertype: BoolVector Sets the boolean values just like in the "model" BoolVector. setCopy ^^^^^^^ .. java:method:: public final void setCopy(BoolVector model, int len) :outertype: BoolVector Sets the boolean values just like in the "model" BoolVector, only for the "len" first bits. The remaining bits are set to false. setDeclared ^^^^^^^^^^^ .. java:method:: public void setDeclared(int zone, int[] curBlockMap, boolean val) :outertype: BoolVector Set the boolean info stored in this BoolVector for the "declared" zone number "zone". setDeclared ^^^^^^^^^^^ .. java:method:: public void setDeclared(TapIntList zones, int[] curBlockMap, boolean val) :outertype: BoolVector Set the boolean info stored in this BoolVector for the "declared" zone numbers "zones". setFalse ^^^^^^^^ .. java:method:: public final void setFalse() :outertype: BoolVector Resets the whole BoolVector to false. setSubInt ^^^^^^^^^ .. java:method:: protected static int setSubInt(int origInt, int cpInt, int fromBit, int toBit) :outertype: BoolVector :return: a bitwise copy of the given "origInt", in which bits [fromBit;toBit[ have been replaced by the leftmost bits of the given "cpInt". setTrue ^^^^^^^ .. java:method:: public final void setTrue() :outertype: BoolVector Resets the whole BoolVector to true. toString ^^^^^^^^ .. java:method:: public final String toString(int[] map) :outertype: BoolVector Builds a String describing the exact contents of this BoolVector, knowing its map. toString ^^^^^^^^ .. java:method:: public final String toString(int size) :outertype: BoolVector Builds a String describing the exact contents of this BoolVector, knowing its exact size. toString ^^^^^^^^ .. java:method:: @Override public final String toString() :outertype: BoolVector Builds a String describing the exact contents of this BoolVector, without knowing its exact length or its map. Therefore, this displays some multiple of 32 booleans, including meaningless trailing booleans. trueIndexList ^^^^^^^^^^^^^ .. java:method:: public final TapIntList trueIndexList(int size) :outertype: BoolVector Converts into the TapIntList of all the indices for which this BoolVector holds true. xor ^^^ .. java:method:: public final BoolVector xor(BoolVector other) :outertype: BoolVector :return: a new BoolVector containing logical XOR between this BoolVector and other.