// Elem extracts the elements of the vector for direct value assignment.
767817
func (v Vec3) Elem() (x, y, z float32) {
	return v[0], v[1], v[2]
}
1110680
func Fill(element interface{}, node *Node) error {
	if element == nil || node == nil {
		return nil
	}

	if node.Kind == 0 {
		return fmt.Errorf("missing node type: %s", node.Name)
	}

	elem := reflect.ValueOf(element)
	if elem.Kind() == reflect.Struct {
		return fmt.Errorf("struct are not supported, use pointer instead")
	}

	return fill(elem.Elem(), node)
}
549241
func (f *FieldSetType) Elements(elems ...FormElement) *FieldSetType {
	for _, e := range elems {
		t := reflect.TypeOf(e)
		switch {
		case t.Implements(reflect.TypeOf((*fields.FieldInterface)(nil)).Elem()):
			f.addField(e.(fields.FieldInterface))
		}
	}
	return f
}
1141772
func (e *Extractor) DecodeNext(match string, elem interface{}) error {
	next, err := e.skipTo(match)
	if err != nil {
		return err
	}
	return e.parser.DecodeElement(elem, &next)
}
233935
func (exp *ArrayExpr) All() []Node {
	all := make([]Node, len(exp.Elements))
	for i, v := range exp.Elements {
		all[i] = v
	}
	return all
}
406454
func (blk *MeasurementBlock) Elem(name []byte) (e MeasurementBlockElem, ok bool) {
	n := int64(binary.BigEndian.Uint64(blk.hashData[:MeasurementNSize]))
	hash := rhh.HashKey(name)
	pos := hash % n

	// Track current distance
	var d int64
	for {
		// Find offset of measurement.
		offset := binary.BigEndian.Uint64(blk.hashData[MeasurementNSize+(pos*MeasurementOffsetSize):])
		if offset == 0 {
			return MeasurementBlockElem{}, false
		}

		// Evaluate name if offset is not empty.
		if offset > 0 {
			// Parse into element.
			var e MeasurementBlockElem
			e.UnmarshalBinary(blk.data[offset:])

			// Return if name match.
			if bytes.Equal(e.name, name) {
				return e, true
			}

			// Check if we've exceeded the probe distance.
			if d > rhh.Dist(rhh.HashKey(e.name), pos, n) {
				return MeasurementBlockElem{}, false
			}
		}

		// Move position forward.
		pos = (pos + 1) % n
		d++

		if d > n {
			return MeasurementBlockElem{}, false
		}
	}
}
509965
func (de *decoder) slice(slval reflect.Value, vb []byte) error {
	// Find the element type, and create a temporary instance of it.
	eltype := slval.Type().Elem()
	val := reflect.New(eltype).Elem()

	// Decide on the wiretype to use for decoding.
	var wiretype int
	switch eltype.Kind() {
	case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Int,
		reflect.Uint32, reflect.Uint64, reflect.Uint:
		if (eltype.Kind() == reflect.Int || eltype.Kind() == reflect.Uint) && eltype.Size() < 8 {
			return errors.New("detected a 32bit machine, please either use (u)int64 or (u)int32")
		}
		switch eltype {

		case sfixed32type:
			wiretype = 5 // Packed 32-bit representation
		case sfixed64type:
			wiretype = 1 // Packed 64-bit representation
		case ufixed32type:
			wiretype = 5 // Packed 32-bit representation
		case ufixed64type:
			wiretype = 1 // Packed 64-bit representation
		default:
			wiretype = 0 // Packed varint representation
		}

	case reflect.Float32:
		wiretype = 5 // Packed 32-bit representation

	case reflect.Float64:
		wiretype = 1 // Packed 64-bit representation

	case reflect.Uint8: // Unpacked byte-slice
		if slval.Kind() == reflect.Array {
			if slval.Len() != len(vb) {
				return errors.New("array length and buffer length differ")
			}
			for i := 0; i < slval.Len(); i++ {
				// no SetByte method in reflect so has to pass down by uint64
				slval.Index(i).SetUint(uint64(vb[i]))
			}
		} else {
			slval.SetBytes(vb)
		}
		return nil

	default: // Other unpacked repeated types
		// Just unpack and append one value from vb.
		if err := de.putvalue(2, val, 0, vb); err != nil {
			return err
		}
		if slval.Kind() != reflect.Slice {
			return errors.New("append to non-slice")
		}
		slval.Set(reflect.Append(slval, val))
		return nil
	}

	// Decode packed values from the buffer and append them to the slice.
	for len(vb) > 0 {
		rem, err := de.value(wiretype, vb, val)
		if err != nil {
			return err
		}
		slval.Set(reflect.Append(slval, val))
		vb = rem
	}
	return nil
}
1201264
func (s *StructInjector) InjectElem(destElem reflect.Value, ctx ...reflect.Value) {
	for _, f := range s.fields {
		f.Object.Assign(ctx, func(v reflect.Value) {
			destElem.FieldByIndex(f.FieldIndex).Set(v)
		})
	}
}
974049
func ElementsWithAttr(e Markup, f, val string) []Markup {
	return DeepElementsWithAttr(e, f, val, 1)
}
1239084
func (a *AttributeValue) Element() *etree.Element {
	el := etree.NewElement("saml:AttributeValue")
	el.CreateAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
	el.CreateAttr("xmlns:xs", "http://www.w3.org/2001/XMLSchema")
	el.CreateAttr("xsi:type", a.Type)
	if a.NameID != nil {
		el.AddChild(a.NameID.Element())
	}
	el.SetText(a.Value)
	return el
}
906496
func (impl *Standard) Sgemm(tA, tB blas.Transpose, m, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) {
	// declared at cublasgen.h:1361:17 enum CUBLAS_STATUS { ... } cublasSgemm ...
	if impl.e != nil {
		return
	}

	if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans {
		panic("blas: illegal transpose")
	}
	if tB != blas.NoTrans && tB != blas.Trans && tB != blas.ConjTrans {
		panic("blas: illegal transpose")
	}
	if m < 0 {
		panic("blas: m < 0")
	}
	if n < 0 {
		panic("blas: n < 0")
	}
	if k < 0 {
		panic("blas: k < 0")
	}
	impl.e = status(C.cublasSgemm(C.cublasHandle_t(impl.h), trans2cublasTrans(tA), trans2cublasTrans(tB), C.int(m), C.int(n), C.int(k), (*C.float)(&alpha), (*C.float)(&a[0]), C.int(lda), (*C.float)(&b[0]), C.int(ldb), (*C.float)(&beta), (*C.float)(&c[0]), C.int(ldc)))
}
402844
func (t *TopK) Elements() []*Element {
	if t.elements.Len() == 0 {
		return make([]*Element, 0)
	}

	elements := make(elementHeap, t.elements.Len())
	copy(elements, *t.elements)
	heap.Init(&elements)
	topK := make([]*Element, 0, t.k)

	for elements.Len() > 0 {
		topK = append(topK, heap.Pop(&elements).(*Element))
	}

	return topK
}
1296960
func Deref(t reflect.Type) reflect.Type {
	if t.Kind() == reflect.Ptr {
		t = t.Elem()
	}
	return t
}
495849
func (elem *remoteWE) rect() (*rect, error) {
	wd := elem.parent
	url := wd.requestURL("/session/%s/element/%s/rect", wd.id, elem.id)
	response, err := wd.execute("GET", url, nil)
	if err != nil {
		return nil, err
	}
	r := new(struct{ Value rect })
	if err := json.Unmarshal(response, r); err != nil {
		return nil, err
	}
	return &r.Value, nil
}
752955
func (a *SubjectConfirmation) Element() *etree.Element {
	el := etree.NewElement("saml:SubjectConfirmation")
	el.CreateAttr("Method", a.Method)
	if a.NameID != nil {
		el.AddChild(a.NameID.Element())
	}
	if a.SubjectConfirmationData != nil {
		el.AddChild(a.SubjectConfirmationData.Element())
	}
	return el
}
960934
func (vector *BitVector) Element(i int) byte {
	vector.indexAssert(i)
	byteIndex := i >> 3
	byteOffset := uint32(i % 8)
	b := vector.data[byteIndex]
	// Check the offset bit
	return (b >> byteOffset) & 1
}
730652
func NewExprIterFromGroupElem(elem *list.Element, p *Pattern) *ExprIter {
	expr := elem.Value.(*GroupExpr)
	if !p.Operand.Match(GetOperand(expr.ExprNode)) {
		return nil
	}
	iter := newExprIterFromGroupExpr(expr, p)
	if iter != nil {
		iter.Element = elem
	}
	return iter
}