Finds the vectors by name and appropriately sets it as active
335148
def set_active_vectors(self, name, preference='cell'):
        """"""
        _, field = get_scalar(self, name, preference=preference, info=True)
        if field == POINT_DATA_FIELD:
            self.GetPointData().SetActiveVectors(name)
        elif field == CELL_DATA_FIELD:
            self.GetCellData().SetActiveVectors(name)
        else:
            raise RuntimeError('Data field ({}) not useable'.format(field))
        self._active_vectors_info = [field, name]
1008156
def set_active_scalar(self, name, preference='cell'):
        """"""
        _, field = get_scalar(self, name, preference=preference, info=True)
        if field == POINT_DATA_FIELD:
            self.GetPointData().SetActiveScalars(name)
        elif field == CELL_DATA_FIELD:
            self.GetCellData().SetActiveScalars(name)
        else:
            raise RuntimeError('Data field ({}) not useable'.format(field))
        self._active_scalar_info = [field, name]
472923
function pivotVector(vectors=[]) {
              return vectors.reduce((result, val, index/*, arr*/) => {
                val.forEach((vecVal, i) => {
                  (index === 0)
                    ? (result.push([vecVal, ]))
                    : (result[ i ].push(vecVal));
                });
                return result;
              }, []);
            }
1261192
void applyActiveTrace()
                    throws java.io.IOException {
        String[] names = activeNames.split(":");

        // Loop over existing Components.
        for (java.util.Iterator traceIterator = activeTrace.values().iterator(); traceIterator.hasNext();) {
            AbstractTrace abstractTrace = (AbstractTrace) traceIterator.next();

            int traceLevelToSet = Trace.Level_None;
            // Loop over active Components, testing to see if any of them is a match.
            for (int i = 0; i < names.length; i++) {
                String name = names[i];
                if (name.equals("*"))
                    name = ".*";
                if (java.util.regex.Pattern.matches(name, abstractTrace.getSourceClass().getName()))
                    traceLevelToSet = traceLevel;
            } // for names...
            abstractTrace.setLevel(traceLevelToSet);
        } // for ... activeTrace Map.

    }
1187875
def values
      active_elements = elements.select do |_, el|
        el.is_a? Elements::Base::ActiveElement
      end

      active_elements.each_with_object({}) do |(name, el), o|
        o[name.to_sym] = el.value
      end
    end
266783
def active_inactive(self):
        """"""
        active_indices = []
        inactive_indices = []
        for index, active in enumerate(self.active):
            if active:
                active_indices.append(index)
            else:
                inactive_indices.append(index)
        return active_indices, inactive_indices
912815
void add_vector(SparseVector vec)
    {

        for (Map.Entry<Integer, Double> entry : vec.entrySet())
        {
            Double v = get(entry.getKey());
            if (v == null)
                v = 0.;
            put(entry.getKey(), v + entry.getValue());
        }
    }
928375
public void setReal( T[] vector )
    {
        if ( vector.length != getSize() )
        {
            throw new IllegalArgumentException("Matrix dimensions do not match. " + getSize() + " not " + vector.length);
        }
        System.arraycopy(vector, 0, real, 0, vector.length);
    }
849483
private static void daxpy(double constant, double vector1[], double vector2[]) {
        if (constant == 0) return;

        assert vector1.length == vector2.length;
        for (int i = 0; i < vector1.length; i++) {
            vector2[i] += constant * vector1[i];
        }
    }
788217
function(vector) {
    var V = vector.elements || vector;
    var n = this.elements.length, k = n, i;
    if (n != V.length) { return null; }
    var dot = 0, mod1 = 0, mod2 = 0;
    // Work things out in parallel to save time
    this.each(function(x, i) {
      dot += x * V[i-1];
      mod1 += x * x;
      mod2 += V[i-1] * V[i-1];
    });
    mod1 = Math.sqrt(mod1); mod2 = Math.sqrt(mod2);
    if (mod1*mod2 === 0) { return null; }
    var theta = dot / (mod1*mod2);
    if (theta < -1) { theta = -1; }
    if (theta > 1) { theta = 1; }
    return Math.acos(theta);
  }
693081
def _get_active_threads_names():
        """"""
        active_threads = threading.enumerate()
        return FormattedText().join(
            [
                FormattedText().newline().normal(" - {name}").start_format().bold(name=thread.name).end_format()
                for thread in active_threads
            ]
        )
424789
function() {
                var A = this.start.elements, B = this.end.elements;
                return vector.create([B[0] - A[0], B[1] - A[1], B[2] - A[2]]);
              }
505842
function(v, w) {
      if (w === undef) {
        w = v.y;
        v = v.x;
      }

      return (Vec2.clean(v) === this.x && Vec2.clean(w) === this.y);
    }
266997
def store_many_vectors(self, hash_name, bucket_keys, vs, data):
        
        if data is None:
            data = itertools.repeat(data)
        for v, k, d in zip(vs, bucket_keys, data):
            self.store_vector(hash_name, k, v, d)
1135612
private void setNotActive(final String[] names) throws DevFailed {
	for (final String name : names) {
	    dev_attr.get_attr_by_name(name).setActive(false);
	}
    }
529589
private void initialize(ReadOnlyVector3 a, ReadOnlyVector3 b, ReadOnlyVector3 c ) 
    {
        final int verts = 3;
        _meshData.setVertexBuffer(BufferUtils.createVector3Buffer(3));
        _meshData.setNormalBuffer(BufferUtils.createVector3Buffer(3));
        final FloatBuffer tbuf = BufferUtils.createVector2Buffer(3);
        _meshData.setTextureBuffer(tbuf, 0);

        _meshData.setIndexBuffer(BufferUtils.createIntBuffer(3));

        Vector3 ba = Vector3.fetchTempInstance();
        Vector3 ca = Vector3.fetchTempInstance();
        ba.set( b ).subtractLocal( a );
        ca.set( c ).subtractLocal( a );
        ba.crossLocal( ca ).normalizeLocal();
        
        _meshData.getNormalBuffer().put(ba.getXf()).put(ba.getYf()).put(ba.getZf());
        _meshData.getNormalBuffer().put(ba.getXf()).put(ba.getYf()).put(ba.getZf());
        _meshData.getNormalBuffer().put(ba.getXf()).put(ba.getYf()).put(ba.getZf());

        Vector3.releaseTempInstance( ba );
        Vector3.releaseTempInstance( ca );
        
        tbuf.put(0).put(1);
        tbuf.put(0).put(0);
        tbuf.put(1).put(0);

        _meshData.getIndexBuffer().put(0);
        _meshData.getIndexBuffer().put(1);
        _meshData.getIndexBuffer().put(2);

        _meshData.getVertexBuffer().put(a.getXf()).put(a.getYf()).put(a.getZf());
        _meshData.getVertexBuffer().put(b.getXf()).put(b.getYf()).put(b.getZf());
        _meshData.getVertexBuffer().put(c.getXf()).put(c.getYf()).put(c.getZf());
    }
43909
def getActiveAxes(self):
        
        names = sorted(k for k in self.keys() if self[k]!=0)
        return names