MCPcopy Create free account
hub / github.com/PX4/eigen / pinsertfirst

Function pinsertfirst

Eigen/src/Core/GenericPacketMath.h:562–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560
561/** \internal \returns \a a with the first coefficient replaced by the scalar b */
562template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
563pinsertfirst(const Packet& a, typename unpacket_traits<Packet>::type b)
564{
565 // Default implementation based on pblend.
566 // It must be specialized for higher performance.
567 Selector<unpacket_traits<Packet>::size> mask;
568 mask.select[0] = true;
569 // This for loop should be optimized away by the compiler.
570 for(Index i=1; i<unpacket_traits<Packet>::size; ++i)
571 mask.select[i] = false;
572 return pblend(mask, pset1<Packet>(b), a);
573}
574
575/** \internal \returns \a a with the last coefficient replaced by the scalar b */
576template<typename Packet> EIGEN_DEVICE_FUNC inline Packet

Callers

nothing calls this directly

Calls 1

pblendFunction · 0.70

Tested by

no test coverage detected