Beispiel #1
0
        /**
         * Adds a boolean Profile to the state with the given key. If no Profile exists, a new Profile is created
         * with the corresponding key. If a Profile exists with that key, the Profile is appended onto the end of the Profile.
         * @param key The key corresponding to the state variable.
         * @param profIn The Profile to be added to the boolean Profile.
         */
        public void addValue(StateVarKey <Matrix <double> > key, HSFProfile <Matrix <double> > profIn)
        {
            HSFProfile <Matrix <double> > valueOut;

            if (!Mdata.TryGetValue(key, out valueOut)) // If there's no Profile matching that key, insert a new one.
            {
                Mdata.Add(key, profIn);
            }
            else // Otherwise, add this data point to the existing Profile.
            {
                valueOut.Add(profIn);
            }
        }
Beispiel #2
0
        /**
         * Adds a Matrix Profile value pair to the state with the given key. If no Profile exists, a new Profile is created
         * with the corresponding key. If a Profile exists with that key, the pair is appended onto the end of the Profile.
         * Ensure that the Profile is still time ordered if this is the case.
         * @param key The key corresponding to the state variable.
         * @param pairIn The pair to be added to the matrix Profile.
         */
        public void addValue(StateVarKey <Matrix <double> > key, KeyValuePair <double, Matrix <double> > pairIn)
        {
            HSFProfile <Matrix <double> > valueIn = new HSFProfile <Matrix <double> >(pairIn);
            HSFProfile <Matrix <double> > valueOut;

            if (!Mdata.TryGetValue(key, out valueOut)) // If there's no Profile matching that key, insert a new one.
            {
                Mdata.Add(key, valueIn);
            }
            else // Otherwise, add this data point to the existing Profile.
            {
                valueOut.Add(pairIn); //TODO: make sure this is ok. was formally iterator.second.data
            }
        }
Beispiel #3
0
        /**
         * Sets the Matrix Profile in the state with its matching key. If a Profile is found already under
         * that key, this will overwrite the old Profile.
         * @param key The Matrix state variable key that is being set.\
         * @param profIn The Matrix Profile being saved.
         */
        public void setProfile(StateVarKey <Matrix <double> > key, HSFProfile <Matrix <double> > profIn)
        {
            HSFProfile <Matrix <double> > valueOut;

            if (!Mdata.TryGetValue(key, out valueOut)) // If there's no Profile matching that key, insert a new one.
            {
                Mdata.Add(key, profIn);
            }
            else   // Otherwise, erase whatever is there, and insert a new one.
            {
                Mdata.Remove(key);
                Mdata.Add(key, profIn);
            }
        }