_id stringlengths 2 7 | title stringclasses 1
value | partition stringclasses 3
values | text stringlengths 6 2.61k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
c20800 | train | // Zero sets the vector's size to n and zeroes out the vector.
// If n is bigger than the vector's size, it will realloc. | {
"resource": ""
} | ||
c20801 | train | // Cross takes the binary cross product of vn and other, and stores it in dst.
// If either vn or other are not of size 3 this function will panic
//
// If dst is not of sufficient size, or is nil, a new slice is allocated.
// Dst is permitted to be one of the other arguments | {
"resource": ""
} | ||
c20802 | train | // Mul multiplies the vector by some scalar value and stores the result in dst,
// which will be returned. Dst will be appropriately resized to the size of vn.
//
// The destination can be vn itself and nothing will go wrong. | {
"resource": ""
} | ||
c20803 | train | // Vec2 constructs a 2-dimensional vector by discarding coordinates. | {
"resource": ""
} | ||
c20804 | train | // Vec3 constructs a 3-dimensional vector by discarding coordinates. | {
"resource": ""
} | ||
c20805 | train | // Vec4 constructs a 4-dimensional vector by discarding coordinates. | {
"resource": ""
} | ||
c20806 | train | // CopyMatMN copies src into dst. This Reshapes dst
// to the same size as src.
//
// If dst or src is nil, this is a no-op | {
"resource": ""
} | ||
c20807 | train | // IdentN stores the NxN identity matrix in dst, reallocating as necessary. | {
"resource": ""
} | ||
c20808 | train | // Zero reshapes the matrix to m by n and zeroes out all
// elements. | {
"resource": ""
} | ||
c20809 | train | // destroy returns the underlying matrix slice to the memory pool | {
"resource": ""
} | ||
c20810 | train | // Transpose takes the transpose of mat and puts it in dst.
//
// If dst is not of the correct dimensions, it will be Reshaped,
// if dst and mat are the same, a temporary matrix of the correct size will
// be allocated; these resources will be released via the memory pool.
//
// This should be improved in the future. | {
"resource": ""
} | ||
c20811 | train | // NumRowCols returns the number of rows and columns in this matrix
// as a single operation | {
"resource": ""
} | ||
c20812 | train | // Add is the arithemtic + operator defined on a MatMxN. | {
"resource": ""
} | ||
c20813 | train | // Sub is the arithemtic - operator defined on a MatMxN. | {
"resource": ""
} | ||
c20814 | train | // Mul performs a scalar multiplication between mat and some constant c,
// storing the result in dst. Mat and dst can be equal. If dst is not the
// correct size, a Reshape will occur. | {
"resource": ""
} | ||
c20815 | train | // MulNx1 multiplies the matrix by a vector of size n. If mat or v is nil, this
// returns nil. If the number of columns in mat does not match the Size of v,
// this also returns nil.
//
// Dst will be resized if it's not big enough. If dst == v; a temporary vector
// will be allocated and returned via the realloc call... | {
"resource": ""
} | ||
c20816 | train | // Add adds two quaternions. It's no more complicated than
// adding their W and V components. | {
"resource": ""
} | ||
c20817 | train | // Sub subtracts two quaternions. It's no more complicated than
// subtracting their W and V components. | {
"resource": ""
} | ||
c20818 | train | // Len gives the Length of the quaternion, also known as its Norm. This is the
// same thing as the Len of a Vec4. | {
"resource": ""
} | ||
c20819 | train | // Mat4 returns the homogeneous 3D rotation matrix corresponding to the
// quaternion. | {
"resource": ""
} | ||
c20820 | train | // ApproxEqual returns whether the quaternions are approximately equal, as if
// FloatEqual was called on each matching element | {
"resource": ""
} | ||
c20821 | train | // Mat4ToQuat converts a pure rotation matrix into a quaternion | {
"resource": ""
} | ||
c20822 | train | // QuatLookAtV creates a rotation from an eye vector to a center vector
//
// It assumes the front of the rotated object at Z- and up at Y+ | {
"resource": ""
} | ||
c20823 | train | // SphericalToCylindrical converts spherical coordinates with radius r,
// inclination theta, and azimuth phi to cylindrical coordinates with radial
// distance r, azimuth phi, and height z.
//
// Angles are in radians | {
"resource": ""
} | ||
c20824 | train | // CylindircalToSpherical converts cylindrical coordinates with radial distance
// r, azimuth phi, and height z to spherical coordinates with radius r,
// inclination theta, and azimuth phi.
//
// Angles are in radians | {
"resource": ""
} | ||
c20825 | train | // ExtractMaxScale extracts the maximum scaling from a homogeneous matrix | {
"resource": ""
} | ||
c20826 | train | // LookAt generates a transform matrix from world space to the given eye space. | {
"resource": ""
} | ||
c20827 | train | // Returns a slice to the appropriate pool. If the slice does not have a cap that's precisely
// a power of 2, this will panic. | {
"resource": ""
} | ||
c20828 | train | // This returns the integer base 2 log of the value
// and whether the log is exact or rounded down.
//
// This is only for positive integers.
//
// There are faster ways to do this, I'm open to suggestions. Most rely on knowing system endianness
// which Go makes hard to do. I'm hesistant to use float conversions and ... | {
"resource": ""
} | ||
c20829 | train | // QuadraticBezierCurve2D interpolates the point t on the given bezier curve. | {
"resource": ""
} | ||
c20830 | train | // QuadraticBezierCurve3D interpolates the point t on the given bezier curve. | {
"resource": ""
} | ||
c20831 | train | // BezierCurve3D same as the 2D version, except the line is in 3D space | {
"resource": ""
} | ||
c20832 | train | // MakeBezierCurve3D same as the 2D version, except with the line in 3D space. | {
"resource": ""
} | ||
c20833 | train | // BezierSplineInterpolate2D does interpolation over a spline of several bezier
// curves. Each bezier curve must have a finite range, though the spline may be
// disjoint. The bezier curves are not required to be in any particular order.
//
// If t is out of the range of all given curves, this function will panic | {
"resource": ""
} | ||
c20834 | train | // Pop removes the first element of the matrix from the stack, if there is only
// one element left there is an error. | {
"resource": ""
} | ||
c20835 | train | // ApproxEqual takes in a vector and does an element-wise approximate float
// comparison as if FloatEqual had been used | {
"resource": ""
} | ||
c20836 | train | // ApproxEqualThreshold takes in a threshold for comparing two floats, and uses
// it to do an element-wise comparison of the vector to another. | {
"resource": ""
} | ||
c20837 | train | // ApproxFuncEqual takes in a func that compares two floats, and uses it to do an element-wise
// comparison of the vector to another. This is intended to be used with FloatEqualFunc | {
"resource": ""
} | ||
c20838 | train | // Push multiplies the current top matrix by m, and pushes the result on the
// stack. | {
"resource": ""
} | ||
c20839 | train | // Pop the current matrix off the top of the stack and returns it. If the matrix
// stack only has one element left, this will return an error. | {
"resource": ""
} | ||
c20840 | train | // Unwind cuts down the matrix as if Pop had been called n times. If n would
// bring the matrix down below 1 element, this does nothing and returns an
// error. | {
"resource": ""
} | ||
c20841 | train | // Rebase replays the current matrix stack as if the transformation that occurred at index "from"
// in ms had instead started at the top of m.
//
// This returns a brand new stack containing all of m followed by all transformations
// at from and after on ms as if they has been done on m instead. | {
"resource": ""
} | ||
c20842 | train | // Frustum generates a Frustum Matrix. | {
"resource": ""
} | ||
c20843 | train | // LookAtV generates a transform matrix from world space into the specific eye
// space. | {
"resource": ""
} | ||
c20844 | train | // Extract3DScale extracts the 3d scaling from a homogeneous matrix | {
"resource": ""
} | ||
c20845 | train | // QuatRotate creates an angle from an axis and an angle relative to that axis.
//
// This is cheaper than HomogRotate3D. | {
"resource": ""
} | ||
c20846 | train | // ApproxEqualThreshold returns whether the quaternions are approximately equal with a given tolerence, as if
// FloatEqualThreshold was called on each matching element with the given epsilon | {
"resource": ""
} | ||
c20847 | train | // ApproxEqualFunc returns whether the quaternions are approximately equal using the given comparison function, as if
// the function had been called on each individual element | {
"resource": ""
} | ||
c20848 | train | // OrientationEqualThreshold returns whether the quaternions represents the same orientation with a given tolerence | {
"resource": ""
} | ||
c20849 | train | // QuatBetweenVectors calculates the rotation between two vectors | {
"resource": ""
} | ||
c20850 | train | // Mat2FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20851 | train | // Mat2FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20852 | train | // Mat2x3FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20853 | train | // Mat2x3FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20854 | train | // Mat2x4FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20855 | train | // Mat2x4FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20856 | train | // Mat3x2FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20857 | train | // Mat3x2FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20858 | train | // Mat3FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20859 | train | // Mat3FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20860 | train | // Mat3x4FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20861 | train | // Mat3x4FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20862 | train | // Mat4x2FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20863 | train | // Mat4x2FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20864 | train | // ApproxEqual performs an element-wise approximate equality test between two matrices,
// as if FloatEqual had been used. | {
"resource": ""
} | ||
c20865 | train | // Mat4x3FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20866 | train | // Mat4x3FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20867 | train | // Mat4FromRows builds a new matrix from row vectors.
// The resulting matrix will still be in column major order, but this can be
// good for hand-building matrices. | {
"resource": ""
} | ||
c20868 | train | // Mat4FromCols builds a new matrix from column vectors. | {
"resource": ""
} | ||
c20869 | train | // Pretty prints the matrix | {
"resource": ""
} | ||
c20870 | train | // Operates like reseed with no bounds checking; allows us to overwrite
// the leading identity matrix with Rebase. | {
"resource": ""
} | ||
c20871 | train | // CubicBezierCurve2D interpolates the point t on the given bezier curve. | {
"resource": ""
} | ||
c20872 | train | // CubicBezierCurve3D interpolates the point t on the given bezier curve. | {
"resource": ""
} | ||
c20873 | train | // BezierSplineInterpolate3D does interpolation over a spline of several bezier
// curves. Each bezier curve must have a finite range, though the spline may be
// disjoint. The bezier curves are not required to be in any particular order.
//
// If t is out of the range of all given curves, this function will panic | {
"resource": ""
} | ||
c20874 | train | // ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
// with a given epsilon threshold, as if FloatEqualThreshold had been used. | {
"resource": ""
} | ||
c20875 | train | // ApproxFuncEqual performs an element-wise approximate equality test between two matrices
// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
// function may be used in practice. | {
"resource": ""
} | ||
c20876 | train | // getAllDepTypes returns a sorted list of names of all dep type
// commands. | {
"resource": ""
} | ||
c20877 | train | // getIoProgressReader returns a reader that wraps the HTTP response
// body, so it prints a pretty progress bar when reading data from it. | {
"resource": ""
} | ||
c20878 | train | // Close closes the file and then removes it from disk. No error is
// returned if the file did not exist at the point of removal. | {
"resource": ""
} | ||
c20879 | train | // getTmpROC returns a removeOnClose instance wrapping a temporary
// file provided by the passed store. The actual file name is based on
// a hash of the passed path. | {
"resource": ""
} | ||
c20880 | train | // getStage1Entrypoint retrieves the named entrypoint from the stage1 manifest for a given pod | {
"resource": ""
} | ||
c20881 | train | // getStage1InterfaceVersion retrieves the interface version from the stage1
// manifest for a given pod | {
"resource": ""
} | ||
c20882 | train | // Loads nets specified by user, both from a configurable user location and builtin from stage1. User supplied network
// configs override what is built into stage1.
// The order in which networks are applied to pods will be defined by their filenames. | {
"resource": ""
} | ||
c20883 | train | // prepareApp sets up the internal runtime context for a specific app. | {
"resource": ""
} | ||
c20884 | train | // computeAppResources processes any isolators that manipulate cgroups. | {
"resource": ""
} | ||
c20885 | train | // GetAciInfosWithKeyPrefix returns all the ACIInfos with a blobkey starting with the given prefix. | {
"resource": ""
} | ||
c20886 | train | // GetAciInfosWithName returns all the ACIInfos for a given name. found will be
// false if no aciinfo exists. | {
"resource": ""
} | ||
c20887 | train | // GetAciInfosWithBlobKey returns the ACIInfo with the given blobKey. found will be
// false if no aciinfo exists. | {
"resource": ""
} | ||
c20888 | train | // GetAllACIInfos returns all the ACIInfos sorted by optional sortfields and
// with ascending or descending order. | {
"resource": ""
} | ||
c20889 | train | // WriteACIInfo adds or updates the provided aciinfo. | {
"resource": ""
} | ||
c20890 | train | // StartCmd takes path to stage1, name of the machine, path to kernel, network describers, memory in megabytes
// and quantity of cpus and prepares command line to run QEMU process | {
"resource": ""
} | ||
c20891 | train | // kvmNetArgs returns additional arguments that need to be passed
// to qemu to configure networks properly. Logic is based on
// network configuration extracted from Networking struct
// and essentially from activeNets that expose NetDescriber behavior | {
"resource": ""
} | ||
c20892 | train | // InitKernelParams sets debug and common parameters passed to the kernel | {
"resource": ""
} | ||
c20893 | train | // Hash uses docker2aci to download the image and convert it to
// ACI, then stores it in the store and returns the hash. | {
"resource": ""
} | ||
c20894 | train | // registerPod registers pod with metadata service.
// Returns authentication token to be passed in the URL | {
"resource": ""
} | ||
c20895 | train | // unregisterPod unregisters pod with the metadata service. | {
"resource": ""
} | ||
c20896 | train | // CheckMdsAvailability checks whether a local metadata service can be reached. | {
"resource": ""
} | ||
c20897 | train | // MergeCNIResult will incorporate the result of a CNI plugin's execution | {
"resource": ""
} | ||
c20898 | train | // Add adds a new multicall command. name is the command name and fn is the
// function that will be executed for the specified command. It returns the
// related Entrypoint.
// Packages adding new multicall commands should call Add in their init
// function. | {
"resource": ""
} | ||
c20899 | train | // addStage1ImageFlags adds flags for specifying custom stage1 image | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.