instruction_seed stringlengths 43 8.03k | source stringclasses 1
value | embeddings listlengths 1.02k 1.02k | mean_positive_score float64 0.73 0.85 | mean_negative_score float64 0.71 0.82 | difference_score float64 0.01 0.07 |
|---|---|---|---|---|---|
You are tasked with creating a program that calculates the factorial of a given number. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, the factorial of 5 is 5 * 4 * 3 * 2 * 1 = 120. Your program should take an input integer from the user and outpu... | glaive | [
0.03302477300167084,
0.01960058882832527,
-0.03020770289003849,
-0.03623092919588089,
0.045924361795186996,
-0.03648453950881958,
-0.02264544740319252,
0.049085430800914764,
0.049224454909563065,
-0.025104740634560585,
0.011181068606674671,
0.05022044479846954,
-0.049917351454496384,
-0.02... | 0.803478 | 0.759096 | 0.044382 |
You are working with a dataset in R and need to understand the different data structures available in the R programming language. You want to create a program that demonstrates the creation and manipulation of different data structures such as vectors, matrices, arrays, lists, and data frames. Your program should cover... | glaive | [
0.018819021061062813,
0.022452151402831078,
-0.02198956161737442,
-0.04326514154672623,
0.032264113426208496,
-0.0335828997194767,
-0.016929402947425842,
0.05873025208711624,
0.04705451428890228,
-0.027858268469572067,
0.00654892111197114,
0.032537929713726044,
-0.0267756599932909,
-0.0077... | 0.786258 | 0.76223 | 0.024028 |
You are tasked with implementing a function in Mathematica that calculates a specific mathematical expression based on the given input. The function should take two parameters, p and q, and calculate the result based on the following formula:
f[p, q] := (c[p-1] - c[q-1]) / (p - q)
You need to implement the function f... | glaive | [
0.03995727375149727,
0.040179263800382614,
-0.03932148963212967,
-0.05272217467427254,
0.055839087814092636,
-0.017513396218419075,
-0.022170109674334526,
0.0719858705997467,
0.07252641022205353,
0.0056210230104625225,
0.020299838855862617,
0.03516655042767525,
-0.024086877703666687,
-0.02... | 0.80195 | 0.765866 | 0.036084 |
You are tasked with implementing a function to perform element-wise addition of two arrays in C++ using the NVIDIA CUDA framework. The function should take two input arrays of type T, each of length len, and produce an output array of the same length, where each element is the sum of the corresponding elements from the... | glaive | [
0.01001163199543953,
0.025478975847363472,
-0.01757260039448738,
-0.023637376725673676,
0.03629322350025177,
0.002047562273219228,
-0.015991562977433205,
0.1226646676659584,
0.04882887005805969,
-0.011711149476468563,
0.015623579733073711,
0.038422372192144394,
-0.008359053172171116,
-0.00... | 0.8004 | 0.777231 | 0.023169 |
You are required to implement a shader program using the given code snippet as a reference. The shader program should calculate the lighting and color of a scene based on the provided signed distance functions (SDF) for various shapes.
The problem involves constructing the scene by using SDF for spheres, planes, and o... | glaive | [
0.016324253752827644,
0.04040002450346947,
-0.037493038922548294,
-0.03641064465045929,
0.026551801711320877,
-0.04116816446185112,
-0.023255392909049988,
0.06757717579603195,
0.04580212011933327,
-0.02059978060424328,
0.04258584976196289,
0.023673688992857933,
-0.0076943919993937016,
0.00... | 0.797387 | 0.781705 | 0.015682 |
You are tasked with finding the least positive integer k for which 3^n divides k!. In other words, given a positive integer n, you need to calculate the smallest k such that 3 raised to the power of n evenly divides k factorial. Write a program to solve this problem. | glaive | [
0.012939241714775562,
0.02637382224202156,
-0.04318971186876297,
-0.05239146575331688,
0.045750442892313004,
-0.023574059829115868,
-0.007259150501340628,
0.048385608941316605,
0.03128502890467644,
-0.01749144308269024,
0.031517621129751205,
0.027324123308062553,
-0.04637116938829422,
-0.0... | 0.827882 | 0.800954 | 0.026927 |
You are tasked with processing a dataset containing five columns: X, Y, TStamp, Pres., EndPts. The dataset has a total of 416 entries. Each entry consists of numerical values separated by spaces. Your goal is to parse this dataset and perform the following operations:
1. Calculate the average of the X and Y values for ... | glaive | [
0.014349868521094322,
0.005250885616987944,
-0.051082462072372437,
-0.044394731521606445,
0.04943658784031868,
-0.03760316222906113,
-0.025272000581026077,
0.06945861876010895,
0.044927481561899185,
-0.00036704863305203617,
0.030343692749738693,
0.017294680699706078,
-0.026538806036114693,
... | 0.815877 | 0.791971 | 0.023905 |
You are tasked with creating a program to calculate the probability amplitudes and visualize the probability distribution of a quantum system. The system consists of 15 qubits and has a specific state amplitude function defined as follows:
amplitude[x_,y_] := (complex expression)
The probability of a particular state... | glaive | [
0.008400420658290386,
0.023346636444330215,
-0.028605353087186813,
-0.030266860499978065,
0.039515286684036255,
-0.031227542087435722,
-0.01993096061050892,
0.06380224227905273,
0.03622505068778992,
0.0037042321637272835,
0.026405619457364082,
0.0345291830599308,
-0.016767624765634537,
-0.... | 0.782417 | 0.750499 | 0.031918 |
You are tasked with developing a CUDA program to solve the k-clique problem for a given graph. The program should be able to find all k-cliques in the graph and count the total number of k-cliques found.
The input to the program will be a graph in CSR (Compressed Sparse Row) format, which is represented as an adjacenc... | glaive | [
-0.022041626274585724,
0.03976407274603844,
-0.021017827093601227,
-0.028569689020514488,
0.022157587110996246,
0.0009410112979821861,
-0.019704807549715042,
0.06273458898067474,
0.03991589695215225,
-0.015651175752282143,
0.02336270920932293,
0.024990467354655266,
-0.0029014372266829014,
... | 0.818918 | 0.784824 | 0.034094 |
I need to create a program to solve a specific system of linear equations using LU decomposition and then apply it to a specific problem involving the computation of a mathematical function. The LU decomposition algorithm and the specific problem are provided. I need to implement the LU decomposition subroutine, the so... | glaive | [
0.008532291278243065,
0.04134336858987808,
-0.03134170174598694,
-0.04954538866877556,
0.035102859139442444,
-0.011797442100942135,
-0.02274230681359768,
0.05919419601559639,
0.03661976009607315,
-0.004983295686542988,
0.018568580970168114,
0.030292559415102005,
-0.018095675855875015,
-0.0... | 0.80515 | 0.778312 | 0.026838 |
You are tasked with creating a function that takes in an array of numbers and returns the maximum value in the array. The function should be named "findMaxValue" and should accept one parameter, an array of numbers. The function should then iterate through the array and compare each element to find the maximum value. O... | glaive | [
0.03998928517103195,
0.037321336567401886,
-0.031082741916179657,
-0.029143771156668663,
0.04033526033163071,
-0.03239146247506142,
-0.02648596093058586,
0.0515727698802948,
0.030236216261982918,
-0.01053014025092125,
0.01970512978732586,
0.03950128331780434,
-0.0350787416100502,
0.0019611... | 0.801031 | 0.758546 | 0.042485 |
You are tasked with implementing a function that fills an array with a specified value using CUDA. The function should be able to handle different data types and input dimensions. Your task is to create a CUDA kernel that fills a 1D or 2D array with a given value. The kernel should be able to handle data types such as ... | glaive | [
0.004162059631198645,
0.06842043250799179,
-0.010419515892863274,
-0.03370562940835953,
0.034573230892419815,
-0.027169663459062576,
-0.018641304224729538,
0.09658183157444,
0.03644105792045593,
-0.02045624330639839,
0.036710225045681,
0.0478803925216198,
-0.011525069363415241,
0.003682262... | 0.79518 | 0.776615 | 0.018565 |
You are tasked with creating a function that evaluates the integrity of a string of brackets. The function should identify any errors in the pairing of brackets and assign a score to each error based on the type of bracket involved.
The function should take a string as input, containing various types of brackets inclu... | glaive | [
0.016743749380111694,
0.028259050101041794,
-0.00422405730932951,
-0.03157668560743332,
0.03775320574641228,
-0.01701883040368557,
-0.012806735932826996,
0.05841460078954697,
0.0173016544431448,
-0.014427348040044308,
0.010284985415637493,
0.024981878697872162,
-0.025135444477200508,
-0.01... | 0.811066 | 0.787638 | 0.023428 |
You have been tasked with creating a function that takes in a string as input and returns the count of each word in the string. The function should ignore punctuation and be case-insensitive. For example, given the input "The sun is shining. The weather is sweet. The sun is shining, and the weather is sweet", the funct... | glaive | [
0.04655400663614273,
0.017141537740826607,
-0.016019383445382118,
-0.02640191651880741,
0.05136238411068916,
-0.04112900421023369,
-0.05168156325817108,
0.04395541548728943,
0.02471858263015747,
-0.009058135561645031,
0.0017991162603721023,
0.03163265809416771,
-0.03331204131245613,
-0.040... | 0.797043 | 0.748037 | 0.049006 |
You are tasked with implementing a Monte Carlo, single chain, NVT ensemble using CBMC (Continuous Breathing Monte Carlo) algorithm. The program takes in a configuration of atom positions in a linear chain without periodic boundary conditions and conducts the simulation in simulation units defined by the model. The prog... | glaive | [
0.01943538524210453,
0.02787935920059681,
-0.025884995236992836,
-0.023890377953648567,
0.04250416159629822,
-0.053504932671785355,
-0.04455031454563141,
0.07751593738794327,
0.010939978063106537,
-0.012362687848508358,
0.027784133329987526,
0.02673042006790638,
-0.018938470631837845,
0.00... | 0.806867 | 0.788266 | 0.018601 |
I need help with converting a binary number to its decimal equivalent using an algorithm. Can someone provide a solution? | glaive | [
0.009059768170118332,
0.008865329436957836,
-0.02561970241367817,
-0.035008106380701065,
0.0402083583176136,
-0.05248377099633217,
-0.022132815793156624,
0.04587836191058159,
0.046071361750364304,
-0.034180570393800735,
0.01660921983420849,
0.001124743721447885,
-0.03911670669913292,
-0.01... | 0.791141 | 0.775931 | 0.01521 |
You are tasked with implementing a function in Scheme that evaluates a polynomial using the Horner's method. The function should take in a value for x and a list of coefficients representing the polynomial. The coefficients are listed in increasing order of powers of x, such that the first element in the list correspon... | glaive | [
0.05118018388748169,
0.02029678411781788,
-0.021303722634911537,
-0.04093522951006889,
0.02223370037972927,
-0.03301616758108139,
-0.011686821468174458,
0.06461779028177261,
0.05516393482685089,
-0.0020181674044579268,
0.026728888973593712,
0.050975967198610306,
-0.02870982699096203,
0.006... | 0.798811 | 0.777384 | 0.021427 |
You are tasked with implementing a non-local means (NLM) image denoising algorithm using CUDA for parallel processing. The goal is to apply a denoising filter to an input image to reduce noise and improve image quality.
The NLM algorithm involves comparing patches of pixels in a window around each pixel in the image t... | glaive | [
-0.025648092851042747,
0.031902700662612915,
-0.02717467024922371,
-0.018219903111457825,
0.0332033634185791,
0.000963339174631983,
-0.036437153816223145,
0.09393636137247086,
0.03525784611701965,
-0.022311104461550713,
0.02984783612191677,
0.011143607087433338,
0.0010251617059111595,
-0.0... | 0.79165 | 0.776306 | 0.015344 |
You are tasked with creating a bingo game board in Rust. The board is represented by a struct with the following fields:
- `data`: a vector containing numbers
- `marked`: a vector of boolean flags indicating which numbers have been drawn
- `count`: holding the count of draws
- `last`: holding the last number drawn
- `b... | glaive | [
0.017690259963274002,
0.022737402468919754,
-0.035160988569259644,
-0.050523508340120316,
0.021511903032660484,
-0.03610869497060776,
-0.011065683327615261,
0.06054912507534027,
0.038374923169612885,
0.011947738006711006,
0.021553099155426025,
0.04185941442847252,
-0.022289296612143517,
-0... | 0.802585 | 0.78806 | 0.014525 |
You are tasked with creating a program to calculate the incarceration rate (as a proportion of 100,000 individuals) in 2002 by race and gender. The input data includes the following information:
- Gender (Female, Male)
- Race (Black, Hispanic, Mixed Race Non Hispanic, Non Black Non Hispanic)
- Incarceration rates for ... | glaive | [
0.008504343219101429,
0.024049635976552963,
-0.04828016832470894,
-0.016782335937023163,
0.022294582799077034,
-0.006315276492387056,
-0.03111877478659153,
0.07382848113775253,
0.06003119423985481,
-0.004349257797002792,
0.014182640239596367,
0.03233896940946579,
-0.011521573178470135,
-0.... | 0.773919 | 0.750752 | 0.023167 |
Write a program to implement a function that calculates the number of extra length bits in a given input. The function should take an integer as input and return the number of extra length bits. Extra length bits are calculated by taking the input and raising it to the power of ExtraLengthBits. | glaive | [
0.014484151266515255,
0.004179386887699366,
-0.024932965636253357,
-0.02566451020538807,
0.04310974106192589,
-0.03521083667874336,
-0.04123031347990036,
0.053868599236011505,
0.049859460443258286,
-0.01134911272674799,
0.02895660139620304,
0.041840918362140656,
-0.06114676222205162,
-0.01... | 0.807961 | 0.787338 | 0.020624 |
You are required to implement a CUDA kernel to perform nearest neighbor gradient resizing on a 4-dimensional input array. The input array has dimensions s1 x s2 x s3 x s4, and the output array should have dimensions d1 x d2 x d3 x d4. The kernel should support float, half, and int data types, and should handle align_co... | glaive | [
0.00010396908328402787,
0.06474116444587708,
-0.009321418590843678,
-0.033703289926052094,
0.03853202611207962,
-0.007055523805320263,
-0.029781943187117577,
0.07933967560529709,
0.04683151841163635,
-0.012048909440636635,
0.029923155903816223,
0.02890510857105255,
-0.011550306342542171,
-... | 0.808564 | 0.787368 | 0.021196 |
You are working on a large-scale data processing application and have noticed that the traditional garbage collection (GC) mechanism is causing significant performance issues. The data processing code creates a large number of objects during each execution, and the majority of these objects become eligible for garbage ... | glaive | [
0.008272374048829079,
0.027753744274377823,
-0.008327181451022625,
-0.006460241973400116,
0.02153824083507061,
-0.04634745046496391,
-0.03907100483775139,
0.06973930448293686,
0.02185087651014328,
-0.028845196589827538,
0.005035861860960722,
0.023782599717378616,
-0.019737770780920982,
0.0... | 0.796829 | 0.78233 | 0.014499 |
You are tasked with implementing a CUDA kernel for inferring harmonic angle parameters in a molecular dynamics simulation. The kernel takes in the following inputs:
- A: number of bonds
- coords: an array of size [N, 3] containing the coordinates of N atoms in 3D space
- params: an array of size [P, 2] containing param... | glaive | [
0.01705806516110897,
0.043417900800704956,
-0.017170490697026253,
-0.022960053756833076,
0.01764940284192562,
-0.0204128660261631,
-0.004117470234632492,
0.07593611627817154,
0.048508040606975555,
-0.010553305968642235,
0.0363830141723156,
0.037069905549287796,
-0.015558543615043163,
0.009... | 0.796406 | 0.780181 | 0.016225 |
You are tasked with implementing a CUDA-accelerated function for Earth Mover's Distance (EMD) calculation on two sets of 3D points. Given two sets of points, `xyz1` of size B x N1 x D and `xyz2` of size B x N2 x D, where B is the batch size, N1/N2 are the number of points in the two sets, and D is the dimensionality of... | glaive | [
0.0168647151440382,
0.03515709564089775,
-0.025955557823181152,
-0.03162655234336853,
0.022842006757855415,
-0.014447414316236973,
-0.04261714965105057,
0.06921521574258804,
0.0548713319003582,
-0.01662430912256241,
0.027524832636117935,
0.05025559663772583,
-0.009395051747560501,
0.005308... | 0.79016 | 0.771477 | 0.018682 |
You are tasked with implementing a program that simulates the evolution of a wavepacket in a square well potential. The given parameters are as follows:
- L: width of the box
- xmin: leftmost point in the box
- N: number of subintervals
- ϵ: width of each subinterval
- k: wavenumbers
- σ: wavepacket width
- x0: wavepac... | glaive | [
0.02419145405292511,
0.03776557743549347,
-0.03581332415342331,
-0.047038838267326355,
0.044113222509622574,
-0.030979879200458527,
-0.033010270446538925,
0.09555935859680176,
0.037217918783426285,
-0.005614445079118013,
0.028715288266539574,
0.030270060524344444,
-0.042809464037418365,
-0... | 0.797855 | 0.776212 | 0.021642 |
You are tasked with implementing a function in the HolKernel Parse boolLib numLib bossLib listTheory framework that partitions a given list based on a predicate. The function should take a predicate P and a list L, and return two lists, l1 and l2, such that l1 contains all the elements of L that satisfy the predicate P... | glaive | [
0.03016561269760132,
0.02472561039030552,
-0.02209310419857502,
-0.030911143869161606,
0.039404965937137604,
-0.01683284528553486,
-0.0012324716662988067,
0.05978480726480484,
0.03444294258952141,
-0.016266997903585434,
0.008380702696740627,
0.03931109607219696,
-0.005749670322984457,
-0.0... | 0.829801 | 0.798488 | 0.031313 |
I need to create a program that handles various unary and binary mathematical operations. The program should be able to perform operations such as floor, ceiling, sine, cosine, absolute value, addition, subtraction, multiplication, division, and comparison operations like equal, not equal, less than, greater than, bitw... | glaive | [
0.027859581634402275,
0.033610597252845764,
-0.033861566334962845,
-0.023894088342785835,
0.03874552994966507,
-0.03379958122968674,
-0.02623903751373291,
0.06379388272762299,
0.04736541211605072,
-0.021491920575499535,
0.020184030756354332,
0.02922106347978115,
-0.02014867775142193,
-0.02... | 0.802164 | 0.774199 | 0.027965 |
You are tasked with creating a program that generates a multiplication table based on user input. The program should prompt the user to enter the dimensions (height and width) of the table. The table should then be printed with the appropriate values in each cell.
Your task is to write a program in Pascal that accompl... | glaive | [
0.03132963553071022,
0.04570635408163071,
-0.020460113883018494,
-0.03473847359418869,
0.039689455181360245,
-0.03143787384033203,
0.008264197036623955,
0.06597606092691422,
0.04145422577857971,
-0.00010065607057185844,
0.009755963459610939,
0.05523999035358429,
-0.0269030574709177,
-0.025... | 0.795494 | 0.772153 | 0.023341 |
You are tasked with implementing a program that applies a Gaussian blur to an image. You are given a color image where each pixel is represented by three channels (red, green, blue), and the image dimensions are 4000x2000. The goal is to create a function that takes in the original image and applies a Gaussian blur to ... | glaive | [
-0.015772007405757904,
0.04498915746808052,
-0.010276298969984055,
-0.026097849011421204,
0.05130838230252266,
-0.004011967685073614,
-0.02079145796597004,
0.08021906763315201,
0.04091653227806091,
-0.01776982843875885,
0.023733055219054222,
0.014208552427589893,
-0.023071741685271263,
-0.... | 0.794264 | 0.779449 | 0.014815 |
You are working with a discrete linear ordered field in your programming project. You need to implement a function that calculates the division of two numbers and ensures that the result is non-negative. Write a function that takes two non-negative numbers `a` and `b` as input, and returns the result of `a / b` if it i... | glaive | [
-0.001742265303619206,
0.004830017685890198,
-0.05108669027686119,
-0.027859551832079887,
0.03316134959459305,
-0.017316220328211784,
-0.016164936125278473,
0.06691580265760422,
0.04363373667001724,
-0.009436485357582569,
0.02245580404996872,
0.023996317759156227,
-0.014313657768070698,
-0... | 0.823286 | 0.801655 | 0.021632 |
You are tasked with writing a program that takes three input values representing the sides of a geometric figure and calculates the area of various shapes using the given inputs. The shapes to calculate are a triangle, a circle, a trapezoid, a square, and a rectangle. The formulae to calculate the area of each shape ar... | glaive | [
0.015072096139192581,
0.04786331579089165,
-0.04285156726837158,
-0.03239564225077629,
0.03212232142686844,
-0.01645112782716751,
-0.01695438288152218,
0.04864972084760666,
0.03143233060836792,
-0.022216442972421646,
0.037296418100595474,
0.052544742822647095,
-0.03842996805906296,
-0.0241... | 0.797111 | 0.751318 | 0.045793 |
You are tasked with creating a program that calculates the probability of a quantum state. The program should take into account the amplitude of the state, which is defined by the function `amplitude[x_,y_]`. The probability of the state is given by the function `probability[x_, y_]`, and should be calculated for a giv... | glaive | [
-0.007499701343476772,
0.03036109171807766,
-0.02937411330640316,
-0.021579289808869362,
0.04235166683793068,
-0.016340048983693123,
-0.01500004157423973,
0.07284697145223618,
0.03656306862831116,
0.0025471618864685297,
0.023018669337034225,
0.035670164972543716,
-0.013162840157747269,
-0.... | 0.786401 | 0.757106 | 0.029295 |
:
Write a program that implements a binary neural net framework using C++ and CUDA. The program should include the following modules:
- Manager.cu
- LocalHeap.cu
- FrameBufferCopy.cu
- ConvBitToReal.cu
- Vector.cu
- MatrixColwiseSum.cu
- MatrixColwiseMeanVar.cu
- MatrixRowwiseSetVector.cu
- MicroMlp.cu
- BinaryLut6.cu... | glaive | [
0.0021146449726074934,
0.014822362922132015,
-0.018937064334750175,
-0.010516418144106865,
0.02565029077231884,
-0.02033613808453083,
-0.027815567329525948,
0.08847814053297043,
0.052759669721126556,
-0.02082054875791073,
0.010498584248125553,
0.016335876658558846,
-0.01693873666226864,
-0... | 0.792281 | 0.774974 | 0.017307 |
You have been tasked with implementing a function to prove equality between two functors in a category. The function should take two functors `F` and `G` from category `C` to category `D` and two proofs: `h_obj` proving equality between the objects of `F` and `G`, and `h_map` proving equality between the morphisms of `... | glaive | [
0.021332990378141403,
0.010513322427868843,
-0.023752329871058464,
-0.03793224319815636,
0.034120187163352966,
-0.03301741182804108,
-0.0005956607055850327,
0.0843520313501358,
0.046121079474687576,
-0.02999497391283512,
0.005081757437437773,
0.040098339319229126,
-0.023279404267668724,
0.... | 0.788462 | 0.76817 | 0.020292 |
I am trying to solve a linear system of equations but I am not sure how to approach it. The system is given by the equations 4x + y = 4 and 2x + y = -3. Can anyone help me find the values of x and y that satisfy both equations? | glaive | [
0.01589643955230713,
0.007748158182948828,
-0.0568181537091732,
-0.04817443713545799,
0.06418724358081818,
-0.041744787245988846,
-0.009429116733372211,
0.049325186759233475,
0.045939214527606964,
-0.018902791664004326,
0.03251098468899727,
0.047983989119529724,
-0.04055282473564148,
-0.03... | 0.77218 | 0.750929 | 0.021251 |
You are tasked with implementing a CUDA kernel function that sets random spins for a given number of particles in a 3D space. The function should take the positions of the particles, an array of random number generator states, the block size, the number of blocks, and the total number of particles as input. The functio... | glaive | [
-0.008523311465978622,
0.05008642375469208,
-0.013014579191803932,
-0.01899653859436512,
0.023447025567293167,
-0.003146631643176079,
-0.045149438083171844,
0.0691198781132698,
0.03577601909637451,
-0.012158789671957493,
0.0282652135938406,
0.03206679970026016,
-0.009626911021769047,
0.014... | 0.800807 | 0.784866 | 0.015941 |
You are tasked with performing trajectory-centric analysis on a dataset containing trajectory data. The goal is to conduct permutation tests and ANOVA analysis on various treatments and patient numbers. Specifically, you need to shuffle treatments within patients, run linear models and ANOVA tests, and calculate p-valu... | glaive | [
0.005390293430536985,
0.009387616068124771,
-0.038675907999277115,
-0.026685727760195732,
0.022304991260170937,
0.0010776860872283578,
-0.02795700542628765,
0.06547700613737106,
0.02095489390194416,
-0.014935949817299843,
-0.0026774934958666563,
0.018374625593423843,
0.0008591848309151828,
... | 0.786227 | 0.769241 | 0.016986 |
Can you provide an algorithm to calculate the running median of a stream of numbers? | glaive | [
0.014664220623672009,
0.018801121041178703,
-0.029942624270915985,
-0.02219988778233528,
0.020304037258028984,
-0.019108867272734642,
-0.035732634365558624,
0.051539428532123566,
0.02930103987455368,
-0.04890093207359314,
0.01637074537575245,
0.016660276800394058,
-0.03571503609418869,
-0.... | 0.790953 | 0.77185 | 0.019102 |
Jia and An are both reading two different novels. The number of pages Jia has read from her novel is 3/4 of the number of unread pages, while An has already read half of his book. They both decide to read a bit more: Jia reads another 30 pages and An reads another 50 pages. At this time, the number of pages Jia has rea... | glaive | [
0.02477092854678631,
0.011044101789593697,
-0.0410052128136158,
-0.04036949574947357,
0.028489520773291588,
-0.0046827481128275394,
-0.021917246282100677,
0.06478691846132278,
0.024974346160888672,
-0.000661623605992645,
0.011163929477334023,
0.010803181678056717,
-0.05285711959004402,
-0.... | 0.783099 | 0.75537 | 0.027729 |
You need to implement a VHDL entity for an 8-bit adder. The entity should have two input ports, a and b, both of type std_logic_vector(15 downto 0), and two output ports, s and cout, where s is also of type std_logic_vector(15 downto 0) and cout is of type std_logic. The adder should be implemented using the components... | glaive | [
0.029899096116423607,
0.019996976479887962,
-0.007358071859925985,
-0.05131661519408226,
0.03448701277375221,
-0.01448051631450653,
-0.03416110575199127,
0.11921894550323486,
0.046023912727832794,
-0.013625489547848701,
0.00789226870983839,
0.0394279807806015,
-0.012481258250772953,
-0.025... | 0.795988 | 0.781675 | 0.014312 |
You are tasked with implementing a function in the IRREDSOL_DATA.FP[3][73] module that can process and manipulate a nested array structure. The function should take in the nested array as an input and perform the following operations:
1. Iterate through the nested array and extract specific elements based on their indi... | glaive | [
0.02817811816930771,
0.046792857348918915,
-0.014946815557777882,
-0.04231540858745575,
0.03493906185030937,
-0.033187855035066605,
-0.011744272895157337,
0.07363907247781754,
0.03738335520029068,
0.008692200295627117,
0.012550217099487782,
0.01918807625770569,
-0.03323668986558914,
-0.003... | 0.815829 | 0.789433 | 0.026396 |
You are required to create a C++ program that utilizes the k-means clustering algorithm and coreset method to process a given CSV file and generate a coreset output.
The program should take the following command line arguments:
1. Path to the CSV file containing the data
2. Size of the coreset
3. Number of clusters
4.... | glaive | [
0.01231473684310913,
0.02193469926714897,
-0.021254926919937134,
-0.02762957476079464,
0.03494768962264061,
-0.01537505816668272,
-0.022337839007377625,
0.07826020568609238,
0.04967982694506645,
-0.012647991999983788,
0.03779486566781998,
0.02568705752491951,
-0.00721403956413269,
0.012575... | 0.804873 | 0.784675 | 0.020197 |
You are tasked with writing a function in Python that determines whether a given vector $\vec{w}$ is a linear combination of a set of vectors $\vec{v}_1, \vec{v}_2, ..., \vec{v}_n$. A vector $\vec{w}$ is considered to be a linear combination of $\vec{v}_1, \vec{v}_2, ..., \vec{v}_n$ if there exist coefficients $a_1, a_... | glaive | [
0.016134794801473618,
0.032206788659095764,
-0.03037312999367714,
-0.04712265357375145,
0.04954151064157486,
-0.005740786902606487,
0.0014489424647763371,
0.07531620562076569,
0.03484628349542618,
-0.004360309336334467,
0.002733388217166066,
0.023726914077997208,
-0.0067980242893099785,
-0... | 0.810283 | 0.769932 | 0.040352 |
I need help with counting the number of occurrences of a specific string in an array. Can someone provide me with a solution? | glaive | [
0.0016541588120162487,
0.015345229767262936,
-0.042455028742551804,
-0.02880452759563923,
0.03728940710425377,
-0.04930911958217621,
-0.03105987422168255,
0.04134237766265869,
0.038911107927560806,
-0.02488955669105053,
0.004992789588868618,
-0.009688194841146469,
-0.03599651902914047,
-0.... | 0.793464 | 0.775569 | 0.017896 |
You are tasked with implementing a program to generate a sequence of numbers based on the following rules:
- The sequence starts with 1 and 2 as the first two numbers.
- For n >= 2, each subsequent number in the sequence (a(n)) is calculated using the formula: a(n) = a(n-1) + 10*a(n-2).
Write a program to generate the... | glaive | [
0.02626713551580906,
0.02912013605237007,
-0.02436966635286808,
-0.03686993569135666,
0.02551230415701866,
-0.03535761311650276,
-0.02660422958433628,
0.07853057980537415,
0.012654014863073826,
-0.0464714951813221,
0.036712490022182465,
0.03548728674650192,
-0.05510510876774788,
0.00249093... | 0.82517 | 0.788871 | 0.0363 |
How can I find the two largest elements in an array using AI? | glaive | [
0.03689155355095863,
0.033799853175878525,
-0.026165001094341278,
-0.04079730436205864,
0.02075326070189476,
-0.028689946979284286,
-0.01538543589413166,
0.05982261151075363,
0.032202862203121185,
-0.026644259691238403,
0.026880556717514992,
0.02105627954006195,
-0.017095128074288368,
-0.0... | 0.802023 | 0.783082 | 0.018941 |
You are given a set of natural numbers $\{a_1, a_2, \dots, a_n\}$. Your goal is to divide this set into two parts $S_1$ and $S_2$ in such a way that the absolute difference between the sum of elements in $S_1$ and $S_2$ is minimized. Describe a dynamic programming procedure to calculate the minimum value of this differ... | glaive | [
0.016450710594654083,
0.006261429283767939,
-0.04693128541111946,
-0.02035381831228733,
0.032216139137744904,
-0.021697985008358955,
-0.014646116644144058,
0.05683017149567604,
0.05330889672040939,
-0.01874719187617302,
0.030013252049684525,
0.032780084758996964,
-0.045576516538858414,
0.0... | 0.838655 | 0.798854 | 0.039801 |
You are tasked with implementing a function in LaTeX that calculates the value of a European call option under the Black's model. The Black's model is a popular mathematical model used in finance to determine the price of European call options. The model assumes that the price of the underlying asset follows a geometri... | glaive | [
-0.005435513332486153,
0.03469546139240265,
-0.0226683858782053,
-0.016375362873077393,
0.04704920947551727,
-0.013761742040514946,
-0.02017357014119625,
0.06615000218153,
0.04823726788163185,
-0.012707473710179329,
0.022810649126768112,
0.05197875574231148,
-0.03212380036711693,
0.0129766... | 0.801845 | 0.78396 | 0.017885 |
You are tasked with implementing a function that filters a list of gene sets based on certain criteria. The function should take a list of gene sets, a vector of valid identifiers, and the minimum and maximum number of genes in a list to keep the list. The function should filter out any gene sets that do not meet the s... | glaive | [
0.031113537028431892,
0.016204824671149254,
-0.029156561940908432,
-0.026476845145225525,
0.050148312002420425,
-0.04695521667599678,
-0.04459955915808678,
0.062062643468379974,
0.035556238144636154,
-0.013764634728431702,
0.01874239556491375,
0.0384536013007164,
-0.023692185059189796,
-0.... | 0.801205 | 0.783881 | 0.017324 |
You are tasked with implementing a function that takes in a list of integers and performs certain operations on it. The function should be able to:
- Extract the first element of the list
- Extract the rest of the elements of the list
- Perform a specific operation on the first element
- Create a new list based on the ... | glaive | [
0.0467488169670105,
0.0400920994579792,
-0.022675687447190285,
-0.04670198634266853,
0.05311664566397667,
-0.04166572913527489,
-0.01728026010096073,
0.05486881360411644,
0.048735108226537704,
-0.017658397555351257,
0.021725522354245186,
0.030903702601790428,
-0.019133154302835464,
-0.0272... | 0.820935 | 0.790695 | 0.03024 |
You are tasked with creating a Python program to determine if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward, disregarding spaces, punctuation, and capitalization.
Write a function called is_palindrome that takes a string... | glaive | [
0.01889866031706333,
0.02050239033997059,
-0.0100634153932333,
-0.034901075065135956,
0.032882459461688995,
-0.02128184773027897,
0.013063806109130383,
0.06607971340417862,
0.013985722325742245,
-0.021279288455843925,
0.011092506349086761,
0.01635550521314144,
-0.023624880239367485,
-0.032... | 0.804447 | 0.764381 | 0.040066 |
You have a table 't1' in a database, containing columns 'a' and 'x'. You need to write a query to select all values from column 'a' where the rowid is greater than or equal to 65535, and then order the results by column 'x'.
Write a SQL query to accomplish this task. | glaive | [
0.04062805697321892,
0.02825137786567211,
-0.01800660789012909,
-0.02371864765882492,
0.007461182307451963,
-0.04024164378643036,
-0.019561519846320152,
0.04727308079600334,
0.04613040015101433,
0.006241231225430965,
0.0297408364713192,
0.014394371770322323,
-0.03663173317909241,
-0.000293... | 0.796997 | 0.774067 | 0.02293 |
You are tasked with implementing a subroutine in Fortran that calculates the inner product of two 3D matrices. The subroutine should take two input matrices `matbox1` and `matbox2` of type real(8), and an output variable `rbox2` of the same type. The subroutine should utilize parallel processing using OpenMP for effici... | glaive | [
0.016067642718553543,
0.043811291456222534,
-0.02534368820488453,
-0.03590133413672447,
0.04210568591952324,
0.016065292060375214,
-0.02532348595559597,
0.0729617029428482,
0.032624077051877975,
-0.001795231830328703,
0.01687672734260559,
0.04915415123105049,
-0.019643509760499,
-0.0179659... | 0.793116 | 0.766154 | 0.026962 |
You are tasked with implementing a program to solve a diffusion equation using a boxlib framework. The program should read inputs from a file, allocate arrays, build a boxarray respecting a maximum grid size, initialize boundary conditions, and advance the solution in time steps. The problem is to write a program that ... | glaive | [
-0.007799623999744654,
0.022666901350021362,
-0.025531958788633347,
-0.030759602785110474,
0.015162119641900063,
-0.03120565600693226,
-0.03461480513215065,
0.06835389882326126,
0.040217913687229156,
-0.014363773167133331,
0.026861831545829773,
0.028793301433324814,
-0.02246049791574478,
0... | 0.810174 | 0.792179 | 0.017994 |
How can I create a function to find the minimum element in a rotated sorted array? | glaive | [
0.007326154969632626,
0.026624327525496483,
-0.02528206817805767,
-0.029773985967040062,
0.030165238305926323,
-0.023626046255230904,
-0.023520197719335556,
0.05061199888586998,
0.030708879232406616,
-0.015060001984238625,
0.01924637332558632,
0.016543444246053696,
-0.03035210445523262,
-0... | 0.806209 | 0.785191 | 0.021018 |
You are tasked with implementing an interpreter for simply typed lambda calculus ($\lambda_\rightarrow$) expressions. The objective is to define a data structure for representing $\lambda_\rightarrow$ terms, embodying the abstract syntax, type derivation function, and an evaluation function for $\lambda_\rightarrow$ te... | glaive | [
0.008841396309435368,
0.023748470470309258,
-0.03387965261936188,
-0.027097618207335472,
0.04998018220067024,
-0.029153432697057724,
-0.02090880647301674,
0.08439549803733826,
0.0357264019548893,
-0.028353601694107056,
0.028200550004839897,
0.05408462509512901,
-0.022917021065950394,
-0.00... | 0.814327 | 0.798494 | 0.015834 |
How can I design a heuristic algorithm to solve a maze problem? | glaive | [
0.009209953248500824,
0.003930117003619671,
-0.016614748165011406,
-0.04904245212674141,
0.03191458433866501,
-0.009821061044931412,
-0.02715407684445381,
0.04277056083083153,
0.018718374893069267,
-0.027572952210903168,
0.014401835389435291,
0.013792095705866814,
-0.009502038359642029,
-0... | 0.7838 | 0.764146 | 0.019653 |
You are tasked with creating a program that takes in a list of words and returns a new list containing only the words that start with a specific prefix. You need to define a function that takes in the list of words and the prefix as input and returns the filtered list of words.
For example, given the list of words:
[... | glaive | [
0.022723430767655373,
0.037189651280641556,
-0.0034987106919288635,
-0.05019716918468475,
0.031458932906389236,
-0.03821290284395218,
-0.024619663134217262,
0.03769136592745781,
0.04656396061182022,
-0.024106722325086594,
0.02525033988058567,
0.02286815084517002,
-0.0386686697602272,
-0.00... | 0.762789 | 0.746715 | 0.016074 |
You are tasked with writing a program to calculate a sequence based on the following rule:
For any given n, the value of a(n) should be equal to n OR floor(n/2), where OR is a bitwise-OR operation.
You need to implement a function that takes an integer n as input and returns the value of a(n) according to the given rul... | glaive | [
0.024438267573714256,
0.019253483042120934,
-0.03377130627632141,
-0.019560426473617554,
0.02922702021896839,
-0.02171195112168789,
-0.03213899955153465,
0.05786079168319702,
0.030228517949581146,
-0.02052554301917553,
0.021417878568172455,
0.03531918302178383,
-0.044569943100214005,
-0.00... | 0.835205 | 0.784493 | 0.050713 |
You are tasked with creating a program that takes in space-separated graph links in the form of a=b and builds a graph data structure to represent the relationships. Then, the program should allow users to input a discontinuity to test for in the form a!=b, and determine if a direct connection exists between the two no... | glaive | [
0.016854247078299522,
0.0158025361597538,
-0.04014167562127113,
-0.03074263222515583,
0.029496068134903908,
-0.004336124286055565,
0.008081336505711079,
0.07039526849985123,
0.04154844209551811,
-0.02279878780245781,
0.030691776424646378,
0.0376528836786747,
-0.0035539939999580383,
-0.0121... | 0.814523 | 0.797576 | 0.016947 |
You are tasked with implementing a priority queue for storing generic data in Zig. The priority queue should be initialized with a specific comparison function that determines the priority order of the elements. The priority queue should support operations such as adding elements, peeking at the highest priority elemen... | glaive | [
0.024342985823750496,
0.006010407116264105,
-0.006340268068015575,
-0.011240956373512745,
0.028236066922545433,
-0.026260852813720703,
-0.003285182872787118,
0.05176488310098648,
0.025958703830838203,
-0.01074150763452053,
0.03502296656370163,
0.02561304159462452,
-0.010559575632214546,
0.... | 0.797499 | 0.78309 | 0.014409 |
I need help developing a software solution in Python to identify the largest numerical component within a given dataset. Additionally, I would like the program to keep track of the frequency of occurrence of the largest numerical component. Can you assist me with this?
Here is the dataset I would like to analyze:
[10,... | glaive | [
0.019137095659971237,
0.02690267749130726,
-0.0429157093167305,
-0.0400947742164135,
0.027592752128839493,
-0.021247923374176025,
-0.00042871563346125185,
0.05162902921438217,
0.03525017201900482,
-0.005999461282044649,
0.024165166541934013,
0.020275939255952835,
-0.01809394173324108,
-0.0... | 0.809103 | 0.790475 | 0.018628 |
You are tasked with creating a real-mode assembly program that calculates the length of a given string and outputs it to a special I/O port. The program should use the provided `strlen` function to calculate the length of the string and then use the `out` instruction to output the string to the `str_prt_port`. The inpu... | glaive | [
0.013333416543900967,
0.014427416026592255,
-0.028803931549191475,
-0.022836141288280487,
0.024963492527604103,
-0.04745319113135338,
-0.027234626933932304,
0.06827427446842194,
0.05068874731659889,
-0.000098270749731455,
0.022910412400960922,
0.05673661455512047,
-0.023173756897449493,
-0... | 0.81056 | 0.795313 | 0.015246 |
You are tasked with implementing a function to perform matrix multiplication using the given code snippet as a reference. The function should take two input tensors and return the result of the matrix multiplication. The input tensors a and b are of type Tensor, and the function should be able to handle different data ... | glaive | [
0.03435840457677841,
0.055321384221315384,
-0.012495702132582664,
-0.04477912187576294,
0.03763433173298836,
-0.016339626163244247,
-0.021309997886419296,
0.09134240448474884,
0.03970942273736,
-0.006106560118496418,
0.00783501099795103,
0.028862936422228813,
-0.017273494973778725,
-0.0212... | 0.796938 | 0.782021 | 0.014917 |
You are tasked with creating a program that defines a function to modify a 2x3 matrix of integers and then uses a Bayesian model to estimate the parameter 'y' from a normal distribution. Your program should include the function 'foo' which takes an integer 'a' as input, modifies the matrix 'vs' by setting all its eleme... | glaive | [
0.016554726287722588,
0.01583581231534481,
-0.0359157957136631,
-0.03636926785111427,
0.04855305701494217,
-0.027372924610972404,
-0.030179809778928757,
0.06060315668582916,
0.040315307676792145,
-0.013463345356285572,
0.0011604379396885633,
0.04488615319132805,
-0.023158278316259384,
0.00... | 0.80471 | 0.783735 | 0.020975 |
You are tasked with creating a program that calculates the sum of weights for a 5x5 grid of texture samples. The program should iterate through each cell in the grid and calculate the sum of weights for each cell based on the formula:
vRefractColor += tex2D( RefractSampler, vRefractTexCoord + ix * ddx1 + iy * ddy1 );... | glaive | [
-0.0156345646828413,
0.03548421338200569,
-0.03737230598926544,
-0.039029140025377274,
0.05213777348399162,
-0.041467227041721344,
-0.032724302262067795,
0.07262235134840012,
0.028310293331742287,
-0.01711723394691944,
0.039485834538936615,
0.03898606076836586,
-0.03733479604125023,
-0.004... | 0.798459 | 0.771275 | 0.027184 |
You are tasked with implementing a CUDA kernel for elementwise addition of two arrays. The template provided below outlines the parameters and structure required for the CUDA kernel. The goal is to write a CUDA kernel that takes two input arrays, adds them together elementwise, and stores the result in an output array.... | glaive | [
0.011302029713988304,
0.03915134817361832,
-0.012513615190982819,
-0.025980159640312195,
0.03893912956118584,
-0.0172116719186306,
-0.012608450837433338,
0.10152090340852737,
0.04020444303750992,
-0.02724691480398178,
0.025497164577245712,
0.04097357019782066,
-0.011752056889235973,
0.0003... | 0.797535 | 0.782978 | 0.014556 |
You are tasked with implementing a letter tree data structure and search algorithm in Clojure. A letter tree is a tree-like data structure used to efficiently store and search for words. The goal is to create functions that build a letter tree from a restricted dictionary and search for words within the tree.
Write a ... | glaive | [
-0.00016286809113807976,
0.039669547230005264,
-0.020622536540031433,
-0.03222585842013359,
0.02762673981487751,
-0.04692099243402481,
-0.0016841103788465261,
0.044663604348897934,
0.040997087955474854,
-0.02134799398481846,
0.030568217858672142,
0.005009745713323355,
-0.0278353001922369,
... | 0.799347 | 0.772379 | 0.026968 |
You are tasked with implementing a CUDA kernel function for finding the top k values in a dense array. The function signature is as follows:
```c
extern "C" __global__ void k_topk_dense(
size_t dims_1, ssize_t dims_2, ... , dims_NDIM,
INPUT_TYPE *dstv,
size_t offset,
ssize_t dstv_strides_0, ssize_t dst... | glaive | [
0.02054601162672043,
0.06566185504198074,
-0.03049079328775406,
-0.01626962050795555,
0.030803058296442032,
-0.016513802111148834,
-0.025193601846694946,
0.08092642575502396,
0.03261279687285423,
-0.004800943657755852,
0.03619442507624626,
0.027446795254945755,
-0.0135859539732337,
0.02501... | 0.817473 | 0.789219 | 0.028254 |
I need to write a program that computes the value of a sequence based on the following rules:
- The first element of the sequence is 1 (a(1) = 1)
- For any subsequent element a(n+1) = a(n) - (-1)^a(n) * Sum_{k=1..n} a(k)
- If a(n) is odd, then add the partial sum, else subtract
I need to implement a program that takes... | glaive | [
0.032749757170677185,
0.03107558935880661,
-0.03560773283243179,
-0.02439437247812748,
0.03971485793590546,
-0.031046872958540916,
-0.01956969127058983,
0.0625273734331131,
0.03447922691702843,
-0.03556710109114647,
0.03136582672595978,
0.0351923331618309,
-0.04491666704416275,
-0.03444714... | 0.82966 | 0.794761 | 0.0349 |
You are tasked with creating a program that will read all the image files from a specified directory and its subdirectories and then display the total number of images found. You need to write a function that takes the directory path as input and returns the count of image files found. | glaive | [
-0.017729606479406357,
0.005193499848246574,
-0.03526565432548523,
-0.023007990792393684,
0.03378169238567352,
-0.019788721576333046,
-0.04606129229068756,
0.04646957665681839,
0.041794680058956146,
-0.009755775332450867,
0.021762032061815262,
0.020197268575429916,
-0.03572342172265053,
-0... | 0.803312 | 0.78592 | 0.017391 |
You are tasked with writing a program that can take a large set of numbers as input and perform a specific computation on them. The input consists of a long list of integers, and your program should be able to process this list and produce a certain output based on the given requirements. Your program should be able to... | glaive | [
0.032537203282117844,
0.029240798205137253,
-0.032583922147750854,
-0.023167308419942856,
0.03748750686645508,
-0.032701343297958374,
-0.0311793964356184,
0.048911891877651215,
0.039790987968444824,
-0.03448311984539032,
0.02389940619468689,
0.049009647220373154,
-0.020313898101449013,
-0.... | 0.828023 | 0.785827 | 0.042197 |
You are tasked with implementing a function to multiply a list of digits by a single digit. The function should take an integer i and a list l as input and return the result of multiplying each digit in l by i. The result should be returned as a new list. | glaive | [
0.02432234026491642,
0.049382925033569336,
-0.016078826040029526,
-0.06510552018880844,
0.05381864681839943,
-0.024571774527430534,
-0.020174279808998108,
0.035820916295051575,
0.021475598216056824,
-0.012921050190925598,
0.010619770735502243,
0.02855091355741024,
-0.04687904566526413,
-0.... | 0.80959 | 0.774466 | 0.035124 |
You are tasked with creating a program that calculates the probability of a quantum state using a given amplitude function and then visualizes the probability distribution in 3D and 2D plots. The amplitude function is defined as follows:
amplitude[x_,y_] := (huge function...)
The probability is calculated using the a... | glaive | [
0.010589202865958214,
0.030675627291202545,
-0.035858459770679474,
-0.031842708587646484,
0.03510915860533714,
-0.027727339416742325,
-0.016108207404613495,
0.06613202393054962,
0.04682336375117302,
0.004075325094163418,
0.031024063006043434,
0.03706717491149902,
-0.006840396206825972,
-0.... | 0.784328 | 0.761603 | 0.022726 |
You are tasked with implementing a generic function that compares two values and returns the maximum of the two. The function should be able to handle different types of input, such as integers, floats, and any other type. Additionally, you need to create a function that adds two integers at compile time and returns th... | glaive | [
0.020539136603474617,
0.026442160829901695,
-0.02056407369673252,
-0.02684147097170353,
0.0523129366338253,
-0.037943314760923386,
-0.01568594016134739,
0.05406884104013443,
0.03627724200487137,
-0.025992801412940025,
0.038763124495744705,
0.03887420892715454,
-0.012175427749752998,
0.0043... | 0.812356 | 0.7952 | 0.017156 |
How can I create a Java program that finds the maximum value in a 2-dimensional array and displays its row and column index? | glaive | [
0.007341024931520224,
0.028969109058380127,
-0.045426107943058014,
-0.03216098994016647,
0.020549055188894272,
-0.03883502259850502,
-0.029521655291318893,
0.04440044239163399,
0.02661324478685856,
-0.039223697036504745,
0.03379276767373085,
0.032277707010507584,
-0.04315422847867012,
-0.0... | 0.796022 | 0.780026 | 0.015996 |
You are required to write a program that will analyze a given DNA sequence and identify specific segments, base pairs, and nucleotide changes. The program should be able to identify the segments, base pairs, and nucleotide changes and display them as output. The input will be a DNA sequence and the expected output will... | glaive | [
0.019376544281840324,
0.008502034470438957,
-0.04951666295528412,
-0.021265363320708275,
0.017450561746954918,
-0.032975975424051285,
-0.006286857649683952,
0.07788609713315964,
0.03377969563007355,
-0.005465328227728605,
0.0293895173817873,
0.019429583102464676,
-0.024246690794825554,
0.0... | 0.800928 | 0.786106 | 0.014822 |
You are tasked with implementing a function to perform the matrix-matrix operation in a programming language that uses the MAGMA library. The function should perform the following operation:
C := alpha*A*B + beta*C, or C := alpha*B*A + beta*C,
where alpha and beta are scalars, A is a Hermitian matrix, and B and C are... | glaive | [
0.042346980422735214,
0.026843374595046043,
-0.03218621760606766,
-0.029161689803004265,
0.03514783829450607,
-0.03525743633508682,
-0.010061490349471569,
0.08909273147583008,
0.02511397935450077,
-0.018953334540128708,
0.006644934881478548,
0.03535740450024605,
-0.029613569378852844,
-0.0... | 0.80778 | 0.782329 | 0.02545 |
What is the algorithm to find the sum of all the elements in a given array using Java? | glaive | [
0.0006238947971723974,
0.03156689181923866,
-0.042685121297836304,
-0.04332598298788071,
0.03614847734570503,
-0.04357505962252617,
-0.017210129648447037,
0.02858540043234825,
0.02963343635201454,
-0.04230618104338646,
0.01725681498646736,
0.03128205984830856,
-0.0414707250893116,
-0.00821... | 0.785008 | 0.761826 | 0.023182 |
You are tasked with implementing a program that can calculate the Levenberg-Marquardt parameter for a given set of data points. The Levenberg-Marquardt algorithm is commonly used in nonlinear least squares curve fitting and is essential for solving optimization problems. Your program should be able to handle large data... | glaive | [
-0.001145472633652389,
0.04007600247859955,
-0.03206335008144379,
-0.03209277242422104,
0.0509989857673645,
-0.004606626462191343,
-0.019906137138605118,
0.07769133150577545,
0.01736576482653618,
-0.02172459475696087,
0.005717968102544546,
0.041922494769096375,
-0.02752610482275486,
-0.000... | 0.795507 | 0.774238 | 0.021269 |
You are tasked with implementing a program that sorts an array of double precision floating-point numbers in ascending order using the CUDA programming framework. Your program should instantiate the sort algorithm and ensure that the sorting is done in place, without the need for any auxiliary memory. | glaive | [
0.013980737887322903,
0.019718751311302185,
-0.027755748480558395,
-0.022684935480356216,
0.01370183378458023,
-0.009414168074727058,
-0.020786698907613754,
0.08025339245796204,
0.041879501193761826,
-0.03613545745611191,
0.016897456720471382,
0.028904248028993607,
-0.008991123177111149,
-... | 0.818506 | 0.801802 | 0.016704 |
You need to create a CUDA program to calculate the histogram of an 8-bit grayscale image. The image is represented as a 2D array of unsigned characters and the dimensions of the image are given. The goal is to implement different histogram calculation methods using CUDA, and then compare the performance of these method... | glaive | [
-0.0007628246676176786,
0.030349336564540863,
-0.009846160188317299,
-0.010537168942391872,
0.02650601789355278,
-0.025077618658542633,
-0.032746344804763794,
0.10698946565389633,
0.054731182754039764,
-0.019065799191594124,
0.02124304510653019,
0.018279600888490677,
0.0008535264641977847,
... | 0.793565 | 0.771492 | 0.022073 |
You are required to implement a program that performs matrix operations using the xTRSM algorithm. The program should have the following functionalities:
- Allocate memory for matrices A, B, and X.
- Initialize matrices A and B with random values.
- Copy matrix B to matrix X.
- Perform the xTRSM algorithm on matrix X u... | glaive | [
0.03699292987585068,
0.009200582280755043,
-0.04645001143217087,
-0.03116633929312229,
0.032405149191617966,
-0.010324233211576939,
-0.03033718466758728,
0.0745985358953476,
0.030317872762680054,
-0.022031456232070923,
0.020309412851929665,
0.015210958197712898,
-0.023182030767202377,
-0.0... | 0.81396 | 0.782617 | 0.031342 |
You are tasked with creating a random graph generator in the Common Lisp programming language. The graph should be a k-regular random graph, which means that each node has exactly k edges. The graph should be represented as an adjacency matrix and should be well-formed, meaning each node has exactly k edges. Your task ... | glaive | [
0.007565771229565144,
0.039550308138132095,
-0.032158419489860535,
-0.05300211161375046,
0.03952641040086746,
-0.03752575069665909,
-0.026551909744739532,
0.03764258325099945,
0.03295912966132164,
-0.020754259079694748,
0.02720300294458866,
0.03545048460364342,
-0.016568658873438835,
0.012... | 0.807071 | 0.786901 | 0.02017 |
You are tasked with creating a program to solve the Circuit Satisfiability problem. In this problem, you are given a Boolean circuit with AND, OR, and NOT gates, and your task is to determine if there exists an assignment of true or false values to the input variables that makes the entire circuit evaluate to true.
Y... | glaive | [
-0.007484059315174818,
0.01619168370962143,
-0.047189801931381226,
-0.021773425862193108,
0.03379502147436142,
-0.04942415654659271,
0.0015475410036742687,
0.06322994083166122,
0.03124500811100006,
-0.035566411912441254,
0.018634280189871788,
0.03952006250619888,
-0.010133453644812107,
-0.... | 0.817301 | 0.787467 | 0.029834 |
I have been working on this programming problem related to floating point numbers, specifically a 5-bit float representation. I understand that the sign bit is the most significant bit, followed by the exponent with a bias of 1. The last two bits represent the significand or mantissa. However, I am having trouble under... | glaive | [
0.014506375417113304,
0.02668779529631138,
-0.03996676579117775,
-0.04137891158461571,
0.058055467903614044,
-0.050904951989650726,
-0.013785981573164463,
0.07985174655914307,
0.03094520978629589,
-0.003884258447214961,
0.04198825731873512,
0.034207746386528015,
-0.021393729373812675,
-0.0... | 0.78183 | 0.767408 | 0.014423 |
What is an efficient way to optimize a program that calculates Fibonacci numbers in order to reduce its time complexity? | glaive | [
0.010258112102746964,
0.020740531384944916,
-0.04092514514923096,
-0.025604963302612305,
0.04076666384935379,
-0.030270956456661224,
-0.025042830035090446,
0.05719799920916557,
0.03902045264840126,
-0.022835804149508476,
0.01012869831174612,
0.03669365495443344,
-0.036033667623996735,
-0.0... | 0.793018 | 0.777717 | 0.015301 |
You are working with a dataset that contains information about two independent groups of subjects. The sample means and variances for the two groups are provided as follows:
Group 1:
- Sample mean ($\bar{X}_1$) = 15
- Sample variance ($s^2_1$) = 8
- Sample size ($n_1$) = 20
Group 2:
- Sample mean ($\bar{X}_2$) = 12... | glaive | [
0.0068117245100438595,
0.027413420379161835,
-0.07071595638990402,
-0.06502554565668106,
0.0573892816901207,
-0.03708946704864502,
-0.01275752205401659,
0.07398024201393127,
0.030278973281383514,
-0.008078338578343391,
0.019096633419394493,
0.014719082042574883,
-0.019632242619991302,
-0.0... | 0.7805 | 0.764041 | 0.016459 |
You are tasked with implementing a function in a programming language that takes three parameters: a, b, and c, all of which are of type "nat" (natural numbers), and a function f that takes a natural number as input and returns a natural number. Your function should satisfy the following conditions:
- If a is equal to ... | glaive | [
0.03280206769704819,
0.023614361882209778,
-0.03524655103683472,
-0.03466321900486946,
0.03783547505736351,
-0.026097718626260757,
-0.008266696706414223,
0.06488429754972458,
0.019869405776262283,
-0.015215035527944565,
0.024144839495420456,
0.03254656866192818,
-0.03424445539712906,
-0.02... | 0.834991 | 0.810553 | 0.024438 |
You are tasked with implementing a function in Lisp that takes in a list of tuples, each containing three elements: a number, a number, and a list. The function should process these tuples and return a new list containing only the tuples where the first number is less than the second number. | glaive | [
0.012727806344628334,
0.020701192319393158,
-0.029798349365592003,
-0.04812883958220482,
0.0566377118229866,
-0.021570079028606415,
-0.009520385414361954,
0.06250640749931335,
0.03808187320828438,
-0.005162874702364206,
0.03140046074986458,
0.047950226813554764,
-0.03407781943678856,
-0.03... | 0.821328 | 0.801026 | 0.020302 |
You are tasked with creating a system of processes that form a ring and pass a message around the ring a specified number of times. The start function should take in three parameters: M (the number of times the message should be passed around the ring), N (the number of processes in the ring), and Msg (the message to b... | glaive | [
0.015030451118946075,
0.029385579749941826,
-0.03125838190317154,
-0.01874230057001114,
0.041770707815885544,
-0.04774694889783859,
-0.041411664336919785,
0.06582879275083542,
0.0280473530292511,
-0.007334211375564337,
0.0326717235147953,
0.04882587864995003,
-0.0210008155554533,
-0.014909... | 0.816407 | 0.80072 | 0.015687 |
You are required to create a program that calculates the probability of a quantum state. The program should define a function `probability(x, y)` that takes two input arguments `x` and `y`, and returns the absolute square of the `amplitude` function. The `amplitude` function should be defined as a complex equation invo... | glaive | [
-0.003921534400433302,
0.035427119582891464,
-0.03171312063932419,
-0.016634808853268623,
0.04296350106596947,
-0.012985817156732082,
-0.01909918710589409,
0.07010450214147568,
0.03348671272397041,
0.009381654672324657,
0.02597121149301529,
0.040229227393865585,
-0.014833488501608372,
-0.0... | 0.796759 | 0.767699 | 0.029059 |
You are tasked with creating a CUDA kernel in C++ to update the intensity of a given grid based on the values of the Ez array. The intensity update is calculated using the formula intensity[indx] = intensity[indx] + Ez(firstX + m*stepX, firstY + n*stepX)*Ez(firstX + m*stepX, firstY + n*stepX), where indx is the index o... | glaive | [
0.000468219950562343,
0.049644652754068375,
-0.0011412606108933687,
-0.02409932389855385,
0.022143306210637093,
-0.029239589348435402,
-0.031686458736658096,
0.09709885716438293,
0.04347530007362366,
-0.03844020515680313,
0.03196230158209801,
0.042708009481430054,
-0.007523303851485252,
-0... | 0.797434 | 0.780354 | 0.017079 |
You have been tasked with creating a program to analyze data from a dataset containing information about national parks and monuments. The dataset includes variables such as Type, OtherCamping, TentCampers, RVCampers, BackcountryCampers, ParkName, DayVisits, OtherLodging, and more. Your goal is to write a program that ... | glaive | [
0.017842724919319153,
0.011700861155986786,
-0.05158189311623573,
-0.03247919678688049,
0.022452088072896004,
-0.0565820038318634,
-0.013452420942485332,
0.057231366634368896,
0.042070332914590836,
-0.010878522880375385,
0.03924447298049927,
0.01899353228509426,
-0.0271625816822052,
-0.002... | 0.791395 | 0.774449 | 0.016946 |
Can you provide an algorithm that combines two sorted arrays into a single sorted array? | glaive | [
0.01468189712613821,
0.025198940187692642,
-0.023866472765803337,
-0.033980369567871094,
0.007151232101023197,
-0.009895513765513897,
-0.02202630043029785,
0.043180063366889954,
0.026409761980175972,
-0.025234268978238106,
0.011846386827528477,
0.01658719964325428,
-0.03284960240125656,
-0... | 0.800575 | 0.785033 | 0.015541 |
I am working on a Euler problem using Python and I have written two versions of code to solve the problem. One version uses lists and the other uses dictionaries. Upon testing these codes, I noticed a significant difference in their performance. The version using dictionaries runs incredibly fast, almost thirty times f... | glaive | [
0.001882061711512506,
0.027701765298843384,
-0.022909285500645638,
-0.034054581075906754,
0.041061293333768845,
-0.038258302956819534,
-0.03139524906873703,
0.07067057490348816,
0.046761758625507355,
-0.01998477429151535,
-0.004648519679903984,
0.02928532101213932,
-0.02963428571820259,
0.... | 0.806714 | 0.792193 | 0.014522 |
You are tasked with creating a CUDA kernel function that calculates the dot product of two vectors using parallel processing on a GPU. The dot product is computed by multiplying corresponding elements of the two vectors and summing the results. The challenge is to ensure that the final dot product value is accurately c... | glaive | [
0.005885441321879625,
0.060375865548849106,
-0.02958139404654503,
-0.02003803476691246,
0.03209027647972107,
0.006702451501041651,
-0.035762373358011246,
0.09959568828344345,
0.040606144815683365,
-0.023777365684509277,
0.020213037729263306,
0.040963586419820786,
0.007204747758805752,
0.00... | 0.800344 | 0.782773 | 0.017571 |
You are tasked with implementing a Generalized Linear Model (GLM) for a Bernoulli outcome using Stan, a probabilistic programming language. The goal is to build a model to predict a binary outcome based on a set of predictors. You need to define the data, parameters, and model structure to accurately model the relation... | glaive | [
0.002302240813151002,
0.03141726553440094,
-0.02862907387316227,
-0.07318195700645447,
0.034421395510435104,
-0.03188401833176613,
-0.0441783182322979,
0.062027640640735626,
0.029840877279639244,
-0.035874079912900925,
0.010659689083695412,
0.053839799016714096,
-0.011682487092912197,
0.02... | 0.797297 | 0.780184 | 0.017113 |
You are tasked with implementing a simple stack data structure using the BRAM (Block RAM) module in a hardware description language (HDL) such as Verilog or SystemVerilog. The stack should have a fixed size and be able to store and retrieve elements of a given data type. The stack should support the following operation... | glaive | [
0.04153148829936981,
0.016736159101128578,
-0.02718937024474144,
-0.025753244757652283,
0.04625369608402252,
-0.04340214654803276,
-0.02472301945090294,
0.08690889179706573,
0.041239891201257706,
-0.02331891469657421,
0.012270607054233551,
0.03835582360625267,
-0.027272285893559456,
0.0004... | 0.79969 | 0.784744 | 0.014946 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.