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 need to create a CUDA program that performs matrix transpose on a floating-point matrix. The program should include several kernels that incrementally improve performance by optimizing coalescing, removing shared memory bank conflicts, and eliminating partition camping. The program should also calculate the tile si... | glaive | [
0.014337168075144291,
0.03869122639298439,
-0.02902337536215782,
-0.027684805914759636,
0.04745788872241974,
-0.008569397032260895,
-0.024491507560014725,
0.09032970666885376,
0.038209352642297745,
-0.018187494948506355,
0.02868901751935482,
0.03400531783699989,
-0.013190901838243008,
0.00... | 0.794766 | 0.774789 | 0.019977 |
You are tasked with creating a program in Go that will take a list of numbers as input and calculate the sum of all the even numbers in the list. You need to create a function that will take the list of numbers as a parameter and return the sum of all the even numbers in the list. | glaive | [
0.017374448478221893,
0.009934375993907452,
-0.02907470241189003,
-0.050589680671691895,
0.05612058937549591,
-0.026865962892770767,
-0.019187310710549355,
0.0424976646900177,
0.04336995631456375,
-0.017194295302033424,
0.0049929870292544365,
0.04758579656481743,
-0.04488614946603775,
-0.0... | 0.805798 | 0.786425 | 0.019372 |
You are tasked with implementing a method for comparing two matrices, each represented in a specific format. The matrices are stored as an array of row offsets and an array of column indices, along with an array of values. Your task is to write a CUDA kernel that compares these two matrices by iterating through their e... | glaive | [
0.02078847587108612,
0.02735803835093975,
-0.028834223747253418,
-0.014238644391298294,
0.029828904196619987,
-0.02776205539703369,
-0.018570512533187866,
0.0962773859500885,
0.056377556174993515,
-0.031092491000890732,
0.028343619778752327,
0.02104475162923336,
-0.018589548766613007,
0.01... | 0.811171 | 0.793746 | 0.017425 |
You are tasked with implementing a depth-first traversal and a breadth-first traversal for a binary tree in Haskell. You are given a data structure for a binary tree, along with functions to create an empty tree, a singleton tree, and a node with left and right subtrees. You are also provided with the code for depth-fi... | glaive | [
0.008090980350971222,
0.0158921480178833,
-0.006823867093771696,
-0.044068753719329834,
0.03129827603697777,
-0.0421275869011879,
0.024339379742741585,
0.04853139817714691,
0.03396371379494667,
-0.015810539945960045,
0.03746570646762848,
0.02100910246372223,
-0.01550180371850729,
0.0021105... | 0.806038 | 0.791193 | 0.014844 |
You are tasked with implementing a method to remove a collection of nodes from a graph data structure. The method, named removeNodes, takes a parameter aCollectionOfNodes, which is a collection of nodes to be removed from the graph. The graph is represented by a set of nodes and a set of edges. The nodesWithoutNodes va... | glaive | [
0.0170317180454731,
0.01949620246887207,
-0.0193497221916914,
-0.013833216391503811,
0.03844987973570824,
-0.06219117343425751,
-0.009082019329071045,
0.0626329705119133,
0.055347878485918045,
0.0018396759405732155,
0.022235099226236343,
0.009500663727521896,
-0.020778976380825043,
0.00331... | 0.80164 | 0.776555 | 0.025085 |
You are tasked with implementing a CUDA kernel function that performs concatenation of input data and stores the result in an output buffer. The function signature is as follows:
```c
__global__ void crossbowKernelConcatCompute (
const int count,
const float* input,
const int size,
const int outputChannels,
... | glaive | [
0.018550045788288116,
0.06395167112350464,
-0.009168018586933613,
-0.024298101663589478,
0.03927161544561386,
-0.008325527422130108,
-0.029898306354880333,
0.0966300517320633,
0.052431147545576096,
-0.008339145220816135,
0.03119657002389431,
0.04373273253440857,
-0.005082206800580025,
-0.0... | 0.805375 | 0.788684 | 0.016691 |
You are tasked with implementing a unified radix sort policy in C++ using the provided framework and technology. The policy type includes kernel tuning parameters that guide the kernel compilation for upsweep, spine, and downsweep kernels, as well as enactor tuning parameters that define kernel-dispatch policy. Your ta... | glaive | [
0.017556454986333847,
0.024475662037730217,
-0.0027393142227083445,
-0.008294629864394665,
0.022529207170009613,
-0.025238877162337303,
-0.03003206104040146,
0.09793597459793091,
0.03976823762059212,
-0.00608699070289731,
0.036531075835227966,
0.03406520187854767,
-0.011125747114419937,
-0... | 0.816932 | 0.802051 | 0.014881 |
You are tasked with implementing a function to calculate the confidence interval of a given array of data. The function should take in the array of data and the desired confidence level (in percentage) as input and return the lower and upper bounds of the confidence interval.
The confidence interval is a range of valu... | glaive | [
-0.007652732077986002,
0.027742484584450722,
-0.026828492060303688,
-0.0276337880641222,
0.059666845947504044,
-0.027791963890194893,
-0.019608955830335617,
0.07617373019456863,
0.0383417084813118,
-0.007647699676454067,
0.01825099252164364,
0.024226928129792213,
-0.02746405638754368,
0.00... | 0.787346 | 0.761088 | 0.026258 |
You are tasked with creating a program that models a game board using a 2D array. The game board can contain three types of cells: Floor, Wall, and Marked. You need to implement the following functionalities:
1. Define the Model type alias to represent the 2D array of cells.
2. Define the Cell type to represent the thr... | glaive | [
0.02422947809100151,
0.028469009324908257,
-0.027123112231492996,
-0.039098598062992096,
0.047402895987033844,
-0.03685280680656433,
-0.028343070298433304,
0.06030658259987831,
0.031054046005010605,
-0.020122865214943886,
0.026817068457603455,
0.04821349307894707,
-0.02556796371936798,
0.0... | 0.809355 | 0.778987 | 0.030368 |
You are tasked with implementing a subroutine in Fortran that calculates the expression for Eq. 5.60c. The subroutine runCY_00li1i2 takes in parameters k, l, i1, i2, Xtwiddle, Gtwiddle, Shat5, and N0 and is responsible for calculating C00li1i2. This calculation requires the use of C00lli1 and involves manipulation of d... | glaive | [
-0.0031377801205962896,
0.05156460776925087,
-0.013445085845887661,
-0.031949810683727264,
0.03164612501859665,
-0.035700101405382156,
-0.01615096814930439,
0.06400822848081589,
0.035390354692935944,
-0.017340511083602905,
0.012884629890322685,
0.03696686029434204,
-0.02162076346576214,
0.... | 0.805619 | 0.783801 | 0.021818 |
You have been tasked with creating a program that checks whether a given string contains the substring "true" within it. If the substring is found, the program should return "true", otherwise it should return "false".
For example:
Input: "This is a true statement."
Output: true
Input: "The truth is out there."
Output... | glaive | [
0.024282746016979218,
0.023398172110319138,
-0.037671592086553574,
-0.03401358798146248,
0.03547387197613716,
-0.03597443178296089,
0.013542374595999718,
0.10210510343313217,
0.034847840666770935,
-0.03465137630701065,
0.002989253494888544,
0.026799898594617844,
-0.008739229291677475,
-0.0... | 0.775234 | 0.749953 | 0.025281 |
You are required to write a program that performs vector addition and increment operation using CUDA and MPI. The program should take a vector size as a command-line argument and allocate memory for the vectors on the GPU. It should then distribute the vector elements among multiple MPI processes and perform the vector... | glaive | [
0.009324217215180397,
0.03865992650389671,
-0.014739986509084702,
-0.019345058128237724,
0.02464604564011097,
0.004518183879554272,
-0.03559020534157753,
0.09014463424682617,
0.045175038278102875,
-0.03056252934038639,
0.0070845880545675755,
0.025286952033638954,
-0.012511144392192364,
-0.... | 0.807912 | 0.783386 | 0.024527 |
You are tasked with creating a Python class called `Cube` that represents a 3D cube. The class should have an `__init__` method that takes in two `Vector3D` objects, `start` and `end`, as parameters. The `start` parameter represents the starting point of the cube, and the `end` parameter represents the end point of the... | glaive | [
0.018562765792012215,
0.038694173097610474,
-0.030979806557297707,
-0.010114776901900768,
0.04327847436070442,
-0.029301155358552933,
-0.02962433360517025,
0.03539525344967842,
0.026001915335655212,
-0.012393987737596035,
0.04173116013407707,
0.03775166720151901,
-0.015141092240810394,
-0.... | 0.800214 | 0.773808 | 0.026406 |
You are tasked with creating a program to generate a random string of characters of a specified length. The program should take an integer input from the user to determine the length of the string and then generate a random combination of letters, numbers, and special characters. The string should be displayed to the u... | glaive | [
0.01133002806454897,
0.017245125025510788,
-0.01884593814611435,
-0.04131409525871277,
0.03648528829216957,
-0.05149435997009277,
-0.019033772870898247,
0.03209227696061134,
0.030712254345417023,
-0.02650369703769684,
0.028088072314858437,
0.041879963129758835,
-0.046286690980196,
-0.00834... | 0.795515 | 0.777196 | 0.018319 |
How can I sort a list of lists in Python, where the sorting is based on the length of the sublists? I have an initial list defined as:
```python
a = [['a', 'b', 'c'], ['d', 'e'], ['f', 'g', 'h'], ['i', 'j', 'k', 'l'], ['m', 'n'], ['o']]
```
I would like to sort this list in a way that the sublists with fewer elements... | glaive | [
0.014286492019891739,
0.013431647792458534,
-0.030447596684098244,
-0.046767864376306534,
0.03849823400378227,
-0.04223927482962608,
-0.008396443910896778,
0.03499961271882057,
0.015998059883713722,
-0.00816014688462019,
0.007326171267777681,
0.022749243304133415,
-0.031509097665548325,
-0... | 0.804041 | 0.783364 | 0.020677 |
I need help creating a function in Python that takes two binary numbers as input and performs an addition operation on them. Can someone provide a solution to this problem?
```python
def add_binary_digits(a, b):
# Convert binary to integer first
a_int = int(a, 2) # converting a from binary to integer
b_in... | glaive | [
0.006659582257270813,
0.03229033946990967,
-0.030378172174096107,
-0.020267169922590256,
0.045674122869968414,
-0.03024144284427166,
-0.016024552285671234,
0.057676445692777634,
0.03500795736908913,
0.0024437655229121447,
0.004633218050003052,
0.03657139092683792,
-0.018346775323152542,
-0... | 0.792609 | 0.77392 | 0.01869 |
I need to fully react a polymer formed by smaller units which, when triggered, react with each other such that two adjacent units of the same type and opposite polarity are destroyed. Units' types are represented by letters; units' polarity is represented by capitalization. I also need to figure out which unit type is ... | glaive | [
0.022938242182135582,
0.015874546021223068,
-0.03721650317311287,
-0.05872596427798271,
0.015190073288977146,
-0.04508472979068756,
-0.026824181899428368,
0.05696376413106918,
0.038275133818387985,
-0.021949753165245056,
0.011192632839083672,
0.028901448473334312,
-0.0004570750461425632,
-... | 0.807247 | 0.789823 | 0.017424 |
You are tasked with creating a program that calculates the probability distribution of a quantum system with 16 qubits in 4 states. The quantum state is defined by the amplitude functions `amplitude` and `amplitude2`, and the probability distribution is given by the `probability` function. You need to find the maximum ... | glaive | [
0.0008713844581507146,
0.02866302989423275,
-0.02817251719534397,
-0.0206052977591753,
0.0513649620115757,
-0.028344862163066864,
-0.02884695678949356,
0.07179521024227142,
0.031092284247279167,
-0.001773396390490234,
0.023911722004413605,
0.0391417033970356,
-0.0005133359809406102,
-0.021... | 0.800308 | 0.76425 | 0.036058 |
You are working with bounded linear maps between Banach spaces and need to implement a function that can determine if a given linear map is a bijection. Your task is to create a function `isBijection` that takes in a linear map `f` and checks if it is a bijection. The function should return `true` if the linear map is ... | glaive | [
0.016647495329380035,
0.024693921208381653,
-0.014102778397500515,
-0.03417108207941055,
0.05008485168218613,
-0.02960350178182125,
0.005854295566678047,
0.08211665600538254,
0.04072500765323639,
-0.0007464686641469598,
0.011327126063406467,
0.01577175222337246,
-0.0033588591031730175,
-0.... | 0.821989 | 0.793267 | 0.028722 |
You are tasked with implementing a seed-and-extend alignment algorithm in C++. The algorithm must take two sequences and find the best local alignment between them, using a seed-and-extend approach. The algorithm should be able to return the alignment score, overlap length, and other relevant information about the alig... | glaive | [
0.018451329320669174,
0.010690014809370041,
-0.012638737447559834,
-0.029256831854581833,
0.029782434925436974,
0.0005970443016849458,
-0.03331321105360985,
0.10365885496139526,
0.025628842413425446,
-0.030695311725139618,
0.010375980287790298,
0.01507723331451416,
-0.025409605354070663,
-... | 0.80649 | 0.77088 | 0.03561 |
You are tasked with creating a Haskell program that can take a list of IP addresses in the form of strings and convert them to a list of Pointful data types. Each IP address is represented in the format "x.x.x.x" where x is a number between 0 and 255.
Write a function called `convertToPoints` that takes a list of IP a... | glaive | [
0.019196657463908195,
0.0363287590444088,
-0.011299828067421913,
-0.04438257962465286,
0.037745401263237,
-0.049100037664175034,
0.011005140841007233,
0.01790807768702507,
0.05676335096359253,
-0.023410765454173088,
0.01164172776043415,
0.05200650542974472,
-0.03597773611545563,
-0.0289735... | 0.80315 | 0.785776 | 0.017374 |
You are required to implement a CUDA program that performs parallel processing on a graph represented by nodes and edges. The program should update the label of each node based on the minimum label of its neighboring nodes. The graph is represented using the following data structures:
- `lbl`: Array of nodal labels
- ... | glaive | [
-0.019353816285729408,
0.04486586153507233,
-0.028882145881652832,
-0.013641180470585823,
0.01698044128715992,
-0.02056150883436203,
-0.03693569079041481,
0.09485344588756561,
0.03871593624353409,
-0.018748179078102112,
0.033575743436813354,
0.02253810688853264,
0.0064825802110135555,
0.01... | 0.805802 | 0.787027 | 0.018775 |
You are tasked with creating a program that will calculate the area of a rectangle. Your program should take in the length and width of the rectangle as input, and then output the calculated area. The formula for calculating the area of a rectangle is given by: area = length * width.
Write a program that will prompt t... | glaive | [
0.018005212768912315,
0.04424476996064186,
-0.043004486709833145,
-0.03635166957974434,
0.030592521652579308,
-0.02692858874797821,
-0.028525928035378456,
0.06390659511089325,
0.052211686968803406,
-0.014680235646665096,
0.02282211370766163,
0.05270196124911308,
-0.03488099202513695,
-0.02... | 0.780108 | 0.750011 | 0.030098 |
Can you please explain how to create a program that reverses an array of numbers? | glaive | [
0.019350731745362282,
0.030005186796188354,
-0.02020043134689331,
-0.033020686358213425,
0.027976583689451218,
-0.04032622650265694,
-0.020020702853798866,
0.06177094951272011,
0.04236821085214615,
-0.03306082263588905,
0.014122276566922665,
0.036900974810123444,
-0.0509190633893013,
-0.01... | 0.797145 | 0.780258 | 0.016887 |
You are tasked with writing a program that calculates the partial sums of the square of the sum of unitary divisors of a given number.
The unitary divisors of a number n are all the positive integers that are relatively prime to n. The sum of unitary divisors of n is denoted by usigma(n). Your task is to write a prog... | glaive | [
-0.015178253874182701,
0.044848937541246414,
-0.04172932356595993,
-0.02801978774368763,
0.03803972154855728,
-0.022817958146333694,
-0.013988526538014412,
0.05164260044693947,
0.017225123941898346,
-0.013018285855650902,
0.03126014769077301,
0.025970030575990677,
-0.04919392615556717,
-0.... | 0.831569 | 0.782901 | 0.048668 |
:
You are tasked with implementing a Boolean circuit using the given framework and technology. The circuit should include the following components:
- NOT gate: a 𝔹 ⟷ 𝔹 gate
- CNOT gate: a 𝔹² ⟷ 𝔹² gate
- Toffoli gate: a 𝔹³ ⟷ 𝔹³ gate
- Controlled Toffoli gate: a 𝔹⁴ ⟷ 𝔹⁴ gate
Your task is to implement the circuit... | glaive | [
0.009748182259500027,
0.01951044611632824,
-0.036412544548511505,
-0.015152588486671448,
0.03176124766469002,
-0.057184215635061264,
-0.012311450205743313,
0.07373068481683731,
0.0417468398809433,
-0.017294391989707947,
0.022856296971440315,
0.035850465297698975,
0.006764091085642576,
-0.0... | 0.802261 | 0.786165 | 0.016096 |
You are tasked with implementing a dynamic programming algorithm for solving a specific optimization problem. The problem involves finding the optimal solution for a given optimization problem, taking into account the cost associated with transitioning from one state to another. The code snippet provided includes funct... | glaive | [
0.006338174920529127,
0.014458167366683483,
-0.02892363630235195,
-0.026292545720934868,
0.029781442135572433,
-0.01804022118449211,
-0.0020022992976009846,
0.08037550747394562,
0.03431970253586769,
-0.010872557759284973,
0.027135850861668587,
0.024857938289642334,
-0.013635530136525631,
0... | 0.805749 | 0.790654 | 0.015095 |
Write a C program that calculates the factorial of a given number using a recursive function. The program should take an integer input from the user and output the factorial of that number. Make sure to handle any potential edge cases, such as negative numbers or large inputs. | glaive | [
0.015106444247066975,
0.040305718779563904,
-0.020169802010059357,
-0.020510416477918625,
0.033050332218408585,
-0.03802107647061348,
-0.019980432465672493,
0.07302848994731903,
0.04015736281871796,
-0.02738703228533268,
0.0160354133695364,
0.03826608881354332,
-0.0500066801905632,
-0.0165... | 0.799493 | 0.772564 | 0.026929 |
You are tasked with implementing a quantum probability distribution function and then visualizing it in a 3D plot and contour plot. The probability distribution function is given by the following formula:
\[ P(x, y) = |\text{amplitude}(x, y)|^2 \]
Where the \text{amplitude}(x, y) function is defined as:
\[ \text{amp... | glaive | [
-0.008362776599824429,
0.033291179686784744,
-0.03888003155589104,
-0.026347827166318893,
0.033548787236213684,
-0.016854384914040565,
-0.03635726496577263,
0.07476002722978592,
0.03551339730620384,
0.023147908970713615,
0.029861675575375557,
0.03271271660923958,
-0.009000293910503387,
-0.... | 0.80002 | 0.765515 | 0.034505 |
You are given a set of data consisting of multiple rows and columns. Each row represents a set of numerical values, and each column represents a different data point. Your task is to write a program that calculates the average value for each column and returns the result as a list of averages. | glaive | [
0.007066195830702782,
0.008456609211862087,
-0.0631980299949646,
-0.049344416707754135,
0.050585877150297165,
-0.047126807272434235,
-0.030073368921875954,
0.056667834520339966,
0.053352922201156616,
-0.01827196218073368,
0.024032650515437126,
0.024611301720142365,
-0.04024733603000641,
0.... | 0.795098 | 0.771761 | 0.023337 |
You are tasked with implementing a simple maze-solving algorithm in Rust. You need to define a structure `FieldType` that represents the possible types of fields in a maze, including `Start`, `Goal`, and `Normal`. Additionally, you must create a `Field` struct that represents a single field in the maze. The `Field` str... | glaive | [
0.01641581952571869,
0.011847500689327717,
-0.003821962745860219,
-0.05155274644494057,
0.02911440096795559,
-0.01728769764304161,
-0.013817213475704193,
0.054500747472047806,
0.035447217524051666,
0.00047259440179914236,
0.022830180823802948,
0.022656427696347237,
-0.0056521035730838776,
... | 0.805097 | 0.790748 | 0.014349 |
I want to create a program that simulates a Turing machine using a tape as memory. The tape is a one-dimensional array of integers, and the machine has a head that can move left or right, read from and write to the current cell, and perform loops. The program should take as input a file containing a sequence of operati... | glaive | [
0.026974689215421677,
0.029662668704986572,
-0.032988522201776505,
-0.011719931848347187,
0.026591291651129723,
-0.02793646976351738,
-0.02002713829278946,
0.08604156225919724,
0.015982607379555702,
-0.018392760306596756,
0.017621848732233047,
0.013258812949061394,
-0.03203773871064186,
-0... | 0.814423 | 0.798852 | 0.015572 |
I am trying to find an efficient solution to the 0-1 knapsack problem. Can anyone help me with this? | glaive | [
0.008516550995409489,
0.027302060276269913,
-0.025473689660429955,
-0.014983350411057472,
0.030002515763044357,
-0.008401477709412575,
-0.006767648737877607,
0.04998771846294403,
0.03287845849990845,
-0.023374279960989952,
0.01593943126499653,
0.003217783523723483,
-0.047841209918260574,
-... | 0.80058 | 0.78099 | 0.019589 |
You are required to create a program that transforms a real number into a chain fraction. The program should take a real number as input and output the chain fraction representation of the number. | glaive | [
0.04110708460211754,
0.029518386349081993,
-0.025065544992685318,
-0.04184707999229431,
0.032462771981954575,
-0.022369643673300743,
-0.002751301508396864,
0.06938644498586655,
0.014760925434529781,
-0.032410990446805954,
0.012253884226083755,
0.03964585065841675,
-0.026027025654911995,
-0... | 0.808447 | 0.785701 | 0.022746 |
You are given a function `function[x, y]` that takes two inputs `x` and `y`. Your task is to find the maximum value of this function and the values of `x` and `y` for which this maximum occurs. Additionally, you need to plot this function in 3D and create a contour plot for visualization. | glaive | [
0.028646618127822876,
0.025753667578101158,
-0.05647426098585129,
-0.0238215159624815,
0.031065544113516808,
-0.016368305310606956,
-0.02566702663898468,
0.04756247252225876,
0.06003263220191002,
-0.006307502742856741,
0.03608947992324829,
0.04093194752931595,
-0.018369831144809723,
0.0083... | 0.80876 | 0.780766 | 0.027994 |
You are tasked with implementing the category of thinnings in Agda. Thinnings are represented as a sequence of dots, where each dot on the bottom is joined to a dot on top by a vertical chord. There may be dots on top with no chord incident. Thinnings are closed under identity and composition.
Your task is to implemen... | glaive | [
0.03390584886074066,
0.01192356739193201,
-0.012895964086055756,
-0.01296307798475027,
0.039487361907958984,
-0.03105784021317959,
-0.003134089754894376,
0.06460545212030411,
0.033444248139858246,
0.0023038024082779884,
0.018041502684354782,
0.005797197110950947,
-0.013015840202569962,
0.0... | 0.805279 | 0.77967 | 0.025609 |
Is there a mathematical formula that can help me calculate the height of a triangle, specifically when I have information about the angle, the side lengths, and the side opposite to the given angle? | glaive | [
0.01494632102549076,
0.010384894907474518,
-0.04043476656079292,
-0.04200475290417671,
0.035704389214515686,
-0.03997320681810379,
-0.02877632901072502,
0.04265007749199867,
0.026536036282777786,
-0.021885406225919724,
0.027098748832941055,
0.022767331451177597,
-0.04612785950303078,
-0.02... | 0.755077 | 0.737132 | 0.017945 |
You are tasked with writing a CUDA program to perform matrix-vector multiplication. The program should take two command-line arguments: the dimension of the square matrix (matrixdimension) and the number of iterations to run the multiplication (numberofiterations). The program should then allocate memory for the matrix... | glaive | [
0.00951733160763979,
0.05562177672982216,
-0.026727985590696335,
-0.01861107349395752,
0.02522778883576393,
0.0006094673881307244,
-0.03382589668035507,
0.09376143664121628,
0.029788915067911148,
-0.024866806343197823,
-0.0007287700427696109,
0.03456491976976395,
-0.014566979371011257,
-0.... | 0.789765 | 0.768802 | 0.020962 |
You are tasked with implementing a simple reinforcement learning algorithm to train an agent to navigate through a grid world. The grid world is represented as a 2D array, where each cell can be either an obstacle (denoted by -1) or a regular cell (denoted by 0). The agent can move in four directions: up, down, left, a... | glaive | [
-0.012047489173710346,
0.025014370679855347,
-0.009982829913496971,
-0.04622567072510719,
0.022155648097395897,
-0.03312872350215912,
-0.02914413996040821,
0.06131748482584953,
0.023904746398329735,
-0.017063850536942482,
0.010886840522289276,
0.015001178719103336,
-0.03839876875281334,
-0... | 0.802864 | 0.772566 | 0.030298 |
Create a class that simulates a Stack data structure in JavaScript using an array. The class should have the following methods:
- push(element): Add an element to the top of the stack.
- pop(): Remove and return the element at the top of the stack.
- peek(): Return the element at the top of the stack without removing i... | glaive | [
0.030551565811038017,
0.03577645495533943,
-0.027034735307097435,
-0.03387157618999481,
0.048324260860681534,
-0.04224715009331703,
-0.00922422669827938,
0.0592803917825222,
0.02693988010287285,
-0.023238183930516243,
0.024913959205150604,
0.031156199052929878,
-0.04871799424290657,
-0.005... | 0.81062 | 0.792754 | 0.017866 |
You are tasked with implementing a parallel program in CUDA to estimate the value of PI using the Monte Carlo method. The goal is to create a function that runs on the GPU to calculate the value of PI based on a specified number of steps and using a given formula. Your program should allocate memory for the necessary v... | glaive | [
-0.007328425999730825,
0.04923245683312416,
-0.01670944318175316,
-0.02243555150926113,
0.03687852621078491,
0.00412049749866128,
-0.0354817695915699,
0.08615635335445404,
0.045368678867816925,
-0.02383759245276451,
0.02261868119239807,
0.039163555949926376,
0.0006624687812291086,
0.003508... | 0.801162 | 0.784208 | 0.016954 |
You are tasked with implementing a function to perform the quicksort algorithm on a given vector of values. The quicksort algorithm works by selecting a pivot value from the array and partitioning the other values into two sub-arrays according to whether they are less than or greater than the pivot. The sub-arrays are ... | glaive | [
0.009422024711966515,
0.028371380642056465,
0.01205185055732727,
-0.014632229693233967,
0.02939753420650959,
-0.018937386572360992,
-0.041324812918901443,
0.07636164873838425,
0.03478557989001274,
-0.0023969111498445272,
0.016659818589687347,
0.03099638968706131,
-0.034666758030653,
-0.001... | 0.809199 | 0.760216 | 0.048984 |
You are tasked with implementing a CUDA function to perform a flip operation on a given input array. The flip operation will reverse the order of elements along the specified axes. The goal is to write a CUDA kernel that takes an input array, flips it along the specified axes, and produces the output array.
You are gi... | glaive | [
-0.020289499312639236,
0.05701039358973503,
-0.0035634376108646393,
-0.022922977805137634,
0.02961735986173153,
-0.0023709305096417665,
-0.02780710533261299,
0.09960681200027466,
0.04477863013744354,
-0.015062966383993626,
0.02549782022833824,
0.04449532553553581,
-0.01187831349670887,
0.0... | 0.798296 | 0.779852 | 0.018444 |
You are tasked with implementing CUDA kernel functions for a custom pooling operation called psamask. The psamask operation has two modes: collect and distribute, which are selected based on a parameter called psa_type. The CUDA kernel functions psamask_collect_forward_cuda, psamask_distribute_forward_cuda, psamask_col... | glaive | [
0.01558618899434805,
0.05599522218108177,
-0.021151192486286163,
0.00009320070967078209,
0.018790865316987038,
-0.006935449782758951,
-0.018764249980449677,
0.08517910540103912,
0.05422521382570267,
0.009720126166939735,
0.024189237505197525,
0.04027295112609863,
0.005302074830979109,
-0.0... | 0.797794 | 0.782388 | 0.015407 |
You are working on a project that requires implementing a data structure for truncated types. Truncated types are types that have a certain level of truncation, denoted by a natural number. A type with truncation level n is called an n-Type. Truncation levels are defined as natural numbers, including -2, -1, 0, 1, and ... | glaive | [
0.02271425910294056,
0.019003424793481827,
-0.028418252244591713,
-0.01746431551873684,
0.05342194810509682,
-0.027959898114204407,
0.0060397908091545105,
0.08758873492479324,
0.034511737525463104,
-0.007616742514073849,
0.018398258835077286,
0.029675589874386787,
-0.03160309046506882,
0.0... | 0.809282 | 0.783838 | 0.025443 |
You are tasked with implementing a smooth map from the real numbers to the unit circle in the complex plane. The map should take a real number `t` as input and return the complex number `exp(t * i)`, where `i` is the imaginary unit. Additionally, you need to ensure that this map is a group homomorphism and is smooth.
... | glaive | [
0.018732747063040733,
0.05351519212126732,
-0.010139811784029007,
-0.05631154403090477,
0.05531110242009163,
-0.025597643107175827,
-0.02441409043967724,
0.050873227417469025,
0.04018845409154892,
-0.015680763870477676,
0.03406110033392906,
0.04013275355100632,
-0.006553553510457277,
-0.00... | 0.799288 | 0.778909 | 0.020378 |
I need to create a function that can find the closest value to a given number in a given array. Can you please provide a solution for this problem? | glaive | [
0.020192019641399384,
0.0372370146214962,
-0.028297806158661842,
-0.03414367884397507,
0.0503590889275074,
-0.044098276644945145,
-0.02078675664961338,
0.04657693952322006,
0.049365438520908356,
-0.01605718769133091,
0.018921034410595894,
0.014458718709647655,
-0.0231271144002676,
-0.01169... | 0.809387 | 0.786857 | 0.02253 |
You need to implement a CUDA program that performs the Matrix-Vector Multiplication (MVT). The MVT algorithm multiplies a matrix by a vector to produce a new vector. The algorithm consists of two separate calculations: the first calculation multiplies the matrix by the first vector, and the second calculation multiplie... | glaive | [
0.023873664438724518,
0.03766106814146042,
-0.015268164686858654,
-0.009380199015140533,
0.041719578206539154,
-0.012105525471270084,
-0.02968171052634716,
0.10479501634836197,
0.04815785586833954,
-0.03310615196824074,
0.0063931141048669815,
0.020198263227939606,
0.003237035358324647,
-0.... | 0.794125 | 0.766519 | 0.027606 |
You are tasked with creating a program that calculates the probability of a quantum state given a set of amplitudes. The program should also include a function to maximize the probability and produce 3D and contour plots to visualize the results. | glaive | [
0.0032472528982907534,
0.034469492733478546,
-0.038463909178972244,
-0.02541314996778965,
0.04936886578798294,
-0.021777382120490074,
-0.02043447084724903,
0.07090909779071808,
0.03312257304787636,
-0.010174457915127277,
0.03268938884139061,
0.0395921915769577,
-0.0200723297894001,
-0.0203... | 0.795279 | 0.77426 | 0.021019 |
What is the code to obtain all prime numbers less than or equal to 100? | glaive | [
0.011262327432632446,
0.005293692462146282,
-0.010676458477973938,
-0.04728421941399574,
0.016639787703752518,
-0.04238240048289299,
0.015739280730485916,
0.03271999582648277,
0.03203793987631798,
-0.029880957677960396,
0.015440070070326328,
0.036647867411375046,
-0.04207799583673477,
-0.0... | 0.799425 | 0.778313 | 0.021112 |
You are tasked with implementing a function in the programming language of your choice to calculate the value of the function f, which is defined as follows:
f = x*exp(-2.0/3.0*x)/(x - 2)
The function takes the following parameters:
- rs: a real number
- z: a real number
- xt: a real number
- xs0: a real number
- xs1... | glaive | [
0.017117518931627274,
0.037802692502737045,
-0.03508930280804634,
-0.04853389412164688,
0.050726644694805145,
-0.029631871730089188,
-0.013072206638753414,
0.07066202163696289,
0.03554416820406914,
-0.009328635409474373,
0.028748735785484314,
0.061628639698028564,
-0.02417484112083912,
-0.... | 0.813852 | 0.795117 | 0.018735 |
You are tasked with creating a program in C that calculates the value of pi using the Monte Carlo method. The Monte Carlo method is a statistical technique that uses random sampling to estimate numerical results. In this case, you will simulate the process of throwing darts at a square target with a circle inscribed in... | glaive | [
-0.008473535999655724,
0.045854706317186356,
-0.014315302483737469,
-0.028751231729984283,
0.0476447194814682,
-0.030341938138008118,
-0.0430864617228508,
0.07155179232358932,
0.030823977664113045,
-0.009632794186472893,
0.023719126358628273,
0.03732540085911751,
-0.02942589856684208,
-0.0... | 0.795741 | 0.759463 | 0.036279 |
You are tasked with implementing a parallelized function to perform LU decomposition on a square matrix. The LU decomposition of a matrix A consists of a lower triangular matrix L and an upper triangular matrix U such that A = LU. The provided code snippet uses the Domainslib library to parallelize the LU decomposition... | glaive | [
-0.00497775711119175,
0.05048273503780365,
-0.031704895198345184,
-0.057159461081027985,
0.03533346951007843,
0.008741269819438457,
-0.04006747156381607,
0.07963316887617111,
0.03257782757282257,
-0.016378134489059448,
0.024068307131528854,
0.03173869103193283,
-0.021946946159005165,
-0.01... | 0.806457 | 0.784216 | 0.02224 |
You are tasked with implementing a program that performs Singular Value Decomposition (SVD) using the cuSOLVER library in CUDA. The program should generate a random matrix A of size MxN and then calculate its SVD using the gesvd function from the cuSOLVER library. The program should also print the matrices A, S, U, and... | glaive | [
0.000398817501263693,
0.03664731979370117,
-0.03859385848045349,
-0.02696768194437027,
0.04076610133051872,
-0.017323169857263565,
-0.020471414551138878,
0.09506714344024658,
0.054742682725191116,
-0.027615603059530258,
0.018636085093021393,
0.026161842048168182,
0.0024680125061422586,
-0.... | 0.804724 | 0.784535 | 0.020189 |
You are tasked with creating a program that uses the given code snippet as a basis for parsing and analyzing a specific type of input. The program should be able to handle mathematical expressions, variables, and conditional statements. Additionally, it should be able to handle various data types such as integers and b... | glaive | [
0.0344802588224411,
0.01968778483569622,
-0.04426124319434166,
-0.03458858281373978,
0.054029401391744614,
-0.03538767248392105,
-0.009284521453082561,
0.06247807666659355,
0.04948429763317108,
-0.02088906243443489,
0.017039453610777855,
0.03310247138142586,
-0.023002222180366516,
-0.02524... | 0.812082 | 0.791406 | 0.020677 |
You are tasked with creating a function that takes in a boolean value and returns 0 if the input is false and 1 if the input is true. You must implement this function using the Scheme programming language. | glaive | [
0.02459927275776863,
0.04174111410975456,
-0.0357055626809597,
-0.020987393334507942,
0.04372427985072136,
-0.0420338436961174,
-0.010359734296798706,
0.08215075731277466,
0.026897745206952095,
-0.022562328726053238,
0.013999621383845806,
0.046813078224658966,
-0.007324849721044302,
-0.019... | 0.810975 | 0.793041 | 0.017934 |
You are tasked with creating a VHDL program to display a 4-bit input value on a 7-segment display and control 8 LEDs based on specific conditions. The 7-segment display should show the input value in hexadecimal format, and the LEDs should be controlled as follows:
- LED 3:4 should display the input value directly
- LE... | glaive | [
0.02189398556947708,
0.029619310051202774,
-0.01783890090882778,
-0.04291020333766937,
0.027768611907958984,
-0.03825286403298378,
-0.03811173513531685,
0.07213077694177628,
0.05073922872543335,
-0.013828636147081852,
0.03030148521065712,
0.05272163450717926,
-0.00027769949520006776,
-0.01... | 0.795035 | 0.780723 | 0.014312 |
You are tasked with creating a program that processes a dataset and performs various string manipulation operations on a given string. The program should find the first position of a specified substring (case-insensitive) and the first position of specified characters (case-insensitive). Additionally, the program shoul... | glaive | [
0.008617991581559181,
0.022273005917668343,
-0.015604381449520588,
-0.034691501408815384,
0.03768802806735039,
-0.03752210736274719,
0.007286278530955315,
0.05303915962576866,
0.03119795024394989,
-0.024910392239689827,
0.03103719837963581,
0.013824175111949444,
-0.03460443392395973,
-0.03... | 0.814855 | 0.79237 | 0.022485 |
You are tasked with creating a program in Borland Turbo Pascal that demonstrates a vector balls demo. The program should utilize the provided code snippet as a starting point and should include the following features:
- Display vector balls on the screen using sprite images
- Implement rotation and translation of the v... | glaive | [
0.012149442918598652,
0.03475425764918327,
-0.017413705587387085,
-0.026298202574253082,
0.03305458277463913,
-0.011264524422585964,
-0.006624932400882244,
0.06457654386758804,
0.040435947477817535,
-0.0077842772006988525,
0.029006250202655792,
0.05688903480768204,
-0.01334521733224392,
-0... | 0.790401 | 0.77195 | 0.018451 |
You are tasked with creating a function that generates all permutations of a given set of elements. The function should take in a set of elements and an optional parameter specifying the length of the permutations to generate. For example, given the set {0, 1, 2}, the function should return all possible permutations, s... | glaive | [
0.02520195208489895,
0.029260192066431046,
0.003983021713793278,
-0.027060355991125107,
0.03232167661190033,
-0.04978243261575699,
-0.023684263229370117,
0.043667688965797424,
0.04102864861488342,
-0.018870528787374496,
0.02325216308236122,
0.029859602451324463,
-0.036702752113342285,
-0.0... | 0.789994 | 0.743105 | 0.046889 |
You are tasked with implementing the `math.acos` function in Zig. The `acos` function calculates the arccosine of a number, which is the angle whose cosine is the given number. The function should handle special cases where the input is less than -1 or greater than 1, in which case it should return `nan`. The function ... | glaive | [
0.02003112994134426,
0.031667694449424744,
-0.01751217432320118,
-0.019438235089182854,
0.04493367299437523,
-0.018917080014944077,
0.00014076053048484027,
0.028414227068424225,
0.04228946194052696,
0.014592978172004223,
0.02370995283126831,
0.025072041898965836,
-0.007543480023741722,
0.0... | 0.802296 | 0.782258 | 0.020038 |
You are tasked with implementing a probabilistic model for predicting weekly age-specific mortality rates using the given data and functions. The model involves several parameters and transformations, such as the number of weeks observed, number of states, continuous age bands, and basis rows and columns, among others.... | glaive | [
-0.004605955444276333,
0.016578692942857742,
-0.023709578439593315,
-0.024693481624126434,
0.03547688573598862,
-0.03910071775317192,
-0.01943092606961727,
0.08063670992851257,
0.02932380884885788,
-0.006108320318162441,
0.012656111270189285,
0.041476618498563766,
0.0038356201257556677,
0.... | 0.791521 | 0.772593 | 0.018927 |
You are required to implement a subroutine in Fortran that adds elements to an integer vector in chunks. The subroutine must have the following signature:
```fortran
subroutine expand_vector(vec,n,chunk_size,val,finished)
integer,dimension(:),allocatable,intent(inout) :: vec
integer,intent(inout) :: n
integer,int... | glaive | [
0.035843923687934875,
0.02666013315320015,
-0.009938514791429043,
-0.03625328466296196,
0.039660412818193436,
0.010218765586614609,
0.0013711446663364768,
0.08272308111190796,
0.01847030222415924,
-0.010005518794059753,
0.013756015338003635,
0.04484451562166214,
-0.025928739458322525,
-0.0... | 0.814389 | 0.789801 | 0.024588 |
You are tasked with creating a Python function that takes a list of numbers as input and returns the sum of all the even numbers in the list. Your function should be named "sum_even_numbers" and should take a single parameter, "numbers_list," which is a list of integers. The function should return the sum of all the ev... | glaive | [
0.012465986423194408,
0.01092686876654625,
-0.035177964717149734,
-0.05823715031147003,
0.05128711089491844,
-0.017445342615246773,
-0.014001346193253994,
0.027028147131204605,
0.029787791892886162,
-0.000995586160570383,
0.0026274961419403553,
0.050468090921640396,
-0.03529486060142517,
-... | 0.795108 | 0.756959 | 0.038149 |
You are tasked with implementing a function to update the nth leaf in a tree structure. The tree structure is defined as follows:
- An int-tree is either an integer or an int-treelist
- An int-treelist is either empty or a cons pair of an int-tree and an int-treelist
- A leaf is an integer in the int-tree or int-treeli... | glaive | [
0.016807090491056442,
0.027700964361429214,
-0.011461714282631874,
-0.0407383032143116,
0.04154151678085327,
-0.03880925476551056,
-0.007563394960016012,
0.090452179312706,
0.03315248340368271,
-0.0026428434066474438,
0.0337417908012867,
0.011659939773380756,
-0.05002518370747566,
0.011220... | 0.810407 | 0.787005 | 0.023402 |
You are tasked with implementing a function in Elixir that generates a history of pairings and their corresponding match outcomes for a given list of students. The function should take in a list of student IDs and output a map where each pair of students is mapped to a random match outcome (represented by a number betw... | glaive | [
0.033491529524326324,
0.019528616219758987,
-0.02656719647347927,
-0.051571931689977646,
0.021643241867423058,
-0.011351258493959904,
-0.02533685602247715,
0.03353367745876312,
0.042956721037626266,
-0.010324017144739628,
0.036225784569978714,
0.03285922855138779,
-0.011092860251665115,
-0... | 0.804751 | 0.783227 | 0.021523 |
How can I determine if a string in Python repeats itself? I have strings that can have 500 or more characters and some of these strings repeat themselves for the entire string, while some do not. The repeating sections of the strings can be quite long and I would like to know not only if a string is repeating itself, b... | glaive | [
-0.009279360994696617,
0.019584335386753082,
-0.021838229149580002,
-0.03783562034368515,
0.029148491099476814,
-0.024361593648791313,
0.0011028032749891281,
0.04909103363752365,
0.01298681739717722,
-0.01767709292471409,
0.024481838569045067,
-0.007731871213763952,
-0.027192790061235428,
... | 0.80935 | 0.789774 | 0.019575 |
I need help implementing a search algorithm in Python to find the index of an element in a given sorted list. Can someone provide a solution?
Code:
```python
def binary_search(sorted_list, target):
left, right = 0, len(sorted_list) - 1
while left <= right:
mid = left + (right - left) // 2
if s... | glaive | [
0.019190356135368347,
0.03134762495756149,
-0.031800996512174606,
-0.02323654107749462,
0.02669491060078144,
-0.03611094877123833,
-0.02892269752919674,
0.05591895803809166,
0.03451991453766823,
-0.014752054587006569,
0.02531273476779461,
0.01840926893055439,
-0.03509161248803139,
-0.00684... | 0.820134 | 0.791377 | 0.028757 |
You are tasked with creating a program that draws a histogram and plot, using the given code snippet as a guide. The program should take an input array and output an image representing the histogram or plot. The input array is expected to be of type CV_32S or CV_32F and the output image should be a GpuMat with a depth ... | glaive | [
0.003968521021306515,
0.02693297527730465,
-0.03609869256615639,
-0.024270327761769295,
0.02866560034453869,
-0.03027915395796299,
-0.055213309824466705,
0.08479088544845581,
0.04049329087138176,
-0.029016295447945595,
0.02625741995871067,
0.037770356982946396,
0.00773214315995574,
-0.0057... | 0.786668 | 0.768593 | 0.018075 |
You are tasked with implementing a program that performs element-wise multiplication on a matrix, a vector, and a row vector in a specified programming language. The program should take the input matrices and vectors and apply the element-wise multiplication operation to produce the transformed data. Additionally, the ... | glaive | [
0.024987712502479553,
0.026344381272792816,
-0.025291062891483307,
-0.04845574498176575,
0.043785594403743744,
-0.012530360370874405,
-0.016379589214920998,
0.06568972021341324,
0.03443913161754608,
-0.023737194016575813,
0.010092919692397118,
0.03963153436779976,
-0.032180752605199814,
0.... | 0.810196 | 0.789491 | 0.020705 |
You are required to write a subroutine that generates an N by N scaled Hilbert matrix in array A, along with NRHS right-hand sides in array B and solutions in array X such that A*X=B. The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all entries are integers. The condition number of the Hilbert matrix g... | glaive | [
0.0029040162917226553,
0.03168001398444176,
-0.024301759898662567,
-0.034937534481287,
0.04383420571684837,
-0.03557722643017769,
-0.022751061245799065,
0.07306011766195297,
0.02775029093027115,
-0.013856849633157253,
0.020937563851475716,
0.03597860038280487,
-0.013657710514962673,
0.0031... | 0.815812 | 0.776101 | 0.039711 |
You are working on a CUDA application where you need to implement a sorting algorithm for body AABB cells. The given code snippet includes various GPU kernel functions and utility functions for counting sorting the grid cells in the context of a CUDA application. You need to implement the cuCountingSortCountGridCells, ... | glaive | [
0.007088643964380026,
0.01669018343091011,
-0.013048961758613586,
-0.011425316333770752,
0.011218399740755558,
-0.025366811081767082,
-0.02836853452026844,
0.07703649997711182,
0.021676264703273773,
-0.01631830260157585,
0.008805937133729458,
0.019659550860524178,
-0.015833737328648567,
0.... | 0.805934 | 0.779781 | 0.026153 |
You are tasked with creating a program that specifies the packing of arrays in memory. The program should define the layout of variables in memory and assume that one pointer is given to all variables. The program should implement a temporary scheme that will later need to be revised to take multiple cores into account... | glaive | [
0.025651339441537857,
0.02422766201198101,
-0.051252447068691254,
-0.025592084974050522,
0.03392978012561798,
-0.04572439193725586,
-0.007424729410558939,
0.06847535818815231,
0.036853693425655365,
-0.014299092814326286,
0.007615547627210617,
0.024868987500667572,
-0.032104965299367905,
0.... | 0.811015 | 0.784955 | 0.02606 |
You are tasked with creating a function to calculate all two-electron integrals for a given molecular basis set. The function should take the basis set as input and use the MolecularIntegrals package to perform the calculations. The specific integrals to be calculated are the Coulomb and Exchange integrals using the Ry... | glaive | [
0.03839297965168953,
0.03891891986131668,
-0.022329797968268394,
-0.03767501562833786,
0.03148488327860832,
-0.0380907766520977,
-0.0072956690564751625,
0.031001416966319084,
0.062491338700056076,
-0.014230551198124886,
0.015585541725158691,
0.01678483746945858,
-0.02465214394032955,
-0.00... | 0.785304 | 0.767628 | 0.017676 |
How can I write a C++ program that finds the largest subarray with an equal number of 0's and 1's? | glaive | [
0.012624806724488735,
0.031744569540023804,
-0.03533980995416641,
-0.022610444575548172,
0.028805319219827652,
-0.003173615550622344,
-0.0232026856392622,
0.07053916156291962,
0.030400240793824196,
-0.03398914262652397,
0.035237714648246765,
0.04039473831653595,
-0.036865174770355225,
-0.0... | 0.815194 | 0.786753 | 0.028442 |
You are tasked with creating a CDS interpreter that can evaluate a given CDS (Combinatory Deterministic Strategy) expression. The CDS is a construct that can generate a list of possible combinations of values based on certain rules, and it is used to determine the behavior of a function.
Your task is to implement the ... | glaive | [
0.010373381897807121,
0.0045693195424973965,
-0.04702391475439072,
-0.011646593920886517,
0.04751107096672058,
-0.036314282566308975,
-0.018714629113674164,
0.0726839005947113,
0.04955436289310455,
-0.008014710620045662,
0.020434005185961723,
0.034014057368040085,
-0.036229126155376434,
0.... | 0.806068 | 0.789585 | 0.016483 |
You have been tasked with implementing a procedure to approximate zeros of a cubic equation of the form x^3 + ax^2 + bx + c. You are required to define a procedure "cubic" that takes in coefficients a, b, and c as arguments and returns a lambda function that represents the cubic equation. Additionally, you need to impl... | glaive | [
0.019599391147494316,
0.03629617393016815,
-0.062439460307359695,
-0.01962612196803093,
0.0401393361389637,
-0.03699488937854767,
-0.007180427201092243,
0.061662498861551285,
0.028799040243029594,
-0.00783818680793047,
0.014511358924210072,
0.03572100028395653,
-0.015583016909658909,
-0.01... | 0.785557 | 0.758955 | 0.026602 |
You are tasked with creating a program in Pascal that takes a number `n` as input and outputs the first 10 multiples of `n`. The program should display the result in the format `i x n = result`, where `i` is the iteration number from 1 to 10 and `result` is the product of `i` and `n`. | glaive | [
0.02948017232120037,
0.03096788190305233,
-0.020392924547195435,
-0.029176190495491028,
0.04129914194345474,
-0.029488978907465935,
-0.013244401663541794,
0.06447038799524307,
0.040132492780685425,
-0.0014546747552230954,
0.024717753753066063,
0.05439634621143341,
-0.041985608637332916,
-0... | 0.817062 | 0.785191 | 0.03187 |
You are tasked with creating a program that processes a series of musical beats and notes. The beats are represented as a series of timestamps and a corresponding numerical value, while the notes are represented as a start timestamp, end timestamp, and a numerical value. Your program should be able to process this data... | glaive | [
0.03628133609890938,
0.026231804862618446,
-0.059187959879636765,
-0.005394751206040382,
0.03731438145041466,
-0.030820146203041077,
-0.03143695741891861,
0.07814165949821472,
0.034188054502010345,
-0.014865227043628693,
0.04089653491973877,
0.009685613214969635,
-0.03805183246731758,
-0.0... | 0.811089 | 0.7806 | 0.030489 |
You are tasked with writing a program to generate a triangle of numbers based on the given rules. The triangle should be read by rows, with each row containing a series of numbers. The value of T(n,k) should be equal to n for 0 < k < n, and T(n,0) and T(n,n) should both be equal to 1. Your program should output the tri... | glaive | [
0.036197368055582047,
0.021297330036759377,
-0.038268208503723145,
-0.03850850835442543,
0.04750923067331314,
-0.03569551929831505,
-0.03054659254848957,
0.05029883608222008,
0.019156688824295998,
-0.026530349627137184,
0.03697946295142174,
0.0523352213203907,
-0.040443502366542816,
-0.017... | 0.825682 | 0.775024 | 0.050659 |
You are tasked with creating a Kotlin function that takes in two integers and returns the result of their multiplication. The function should be named "multiply" and should take two parameters, "num1" and "num2", both of type Int. The function should return an Int that is the result of multiplying num1 and num2 togethe... | glaive | [
0.01620819792151451,
0.037806905806064606,
-0.012846501544117928,
-0.05065535381436348,
0.04200494661927223,
-0.010206899605691433,
-0.02290932461619377,
0.054533760994672775,
0.022285014390945435,
-0.023093217983841896,
0.023035550490021706,
0.033865343779325485,
-0.020764488726854324,
0.... | 0.788912 | 0.767258 | 0.021654 |
You are tasked with implementing a CUDA program to calculate the gravitational forces between N bodies using the N-body calculation algorithm. The goal is to take advantage of the symmetry of gravitational forces (Fij=-Fji) and implement a tiled approach to improve performance. The provided code snippet offers a starti... | glaive | [
0.023313991725444794,
0.04234893620014191,
-0.011724721640348434,
-0.023768946528434753,
0.032939303666353226,
-0.03225024417042732,
-0.019615575671195984,
0.0800008624792099,
0.041082583367824554,
-0.01622973196208477,
0.020787715911865234,
0.03991207852959633,
-0.0280216783285141,
-0.014... | 0.80625 | 0.790533 | 0.015717 |
You are tasked with implementing a CUDA C++ program to perform numerical integration using the Cuhre algorithm. The goal is to parallelize the computation of integrals over multi-dimensional regions.
The program requires implementing several CUDA kernels and device functions to achieve this. The main tasks include ini... | glaive | [
0.015158257447183132,
0.03899085149168968,
-0.013262772001326084,
-0.02052140235900879,
0.013926958665251732,
0.026955749839544296,
-0.024966979399323463,
0.09068361669778824,
0.05973917990922928,
-0.017467861995100975,
0.02257521264255047,
0.04084175080060959,
-0.002910412149503827,
-0.00... | 0.78623 | 0.767958 | 0.018271 |
You are given a list of pairs representing connections between nodes in a graph. Each pair represents an edge between two nodes. Your task is to write a program to output the adjacency list representation of the graph.
For example, given the following pairs:
0 8
0 1
7 12
7 16
The output should be:
0 -> 8, 1
7 -> 12, ... | glaive | [
0.034067463129758835,
0.016988184303045273,
-0.03342524170875549,
-0.03651496395468712,
0.04020680487155914,
-0.010838556103408337,
-0.021874327212572098,
0.06033843010663986,
0.03976728022098541,
-0.01961466856300831,
0.030850088223814964,
0.03802070394158363,
-0.029356135055422783,
-0.01... | 0.8232 | 0.775278 | 0.047921 |
You are tasked with creating a Julia function that constructs a witness set for a given polynomial system and linear subspace. The witness set should store the solutions of the polynomial system F(x) = L(x) = 0. The function should allow for the computation of the witness set for a given dimension or codimension, and a... | glaive | [
0.005448539741337299,
0.03391341492533684,
-0.04750005155801773,
-0.050719600170850754,
0.03469592705368996,
-0.03444153070449829,
-0.025093412026762962,
0.08203355222940445,
0.06381326168775558,
-0.004705566912889481,
0.0087339598685503,
0.03564707934856415,
-0.0109355254098773,
-0.001080... | 0.801248 | 0.779028 | 0.02222 |
I need to create a data structure in Julia to represent wrapping paper with a minimum and maximum value, and the number of values between them. The wrapping paper should behave like a number line, where the minimum value minus 1 is equal to the maximum value, and the maximum value plus 1 is equal to the minimum value. ... | glaive | [
-0.019026240333914757,
0.007735107559710741,
-0.04305887222290039,
-0.025247491896152496,
0.04365630820393562,
-0.03339511528611183,
-0.021845197305083275,
0.07185467332601547,
0.044153619557619095,
-0.025966111570596695,
0.02912319079041481,
0.041024480015039444,
-0.013071809895336628,
-0... | 0.80064 | 0.782169 | 0.01847 |
You are tasked with creating a program that calculates costs based on various voltage and current readings. The program should include the following functionalities:
1. VoltageCellAllocation: Allocate and store maximum and minimum voltage cell values, and voltage cost summary values.
2. VoltageCheck: Check if the volt... | glaive | [
0.02008402720093727,
0.03756631910800934,
-0.03529459610581398,
-0.02629370428621769,
0.020589401945471764,
-0.042666736990213394,
-0.017739908769726753,
0.05409146845340729,
0.04273844510316849,
-0.007299841847270727,
0.03376275300979614,
0.02893218770623207,
-0.02443857118487358,
-0.0253... | 0.790512 | 0.775365 | 0.015147 |
You are tasked with creating a program that generates a sequence of numbers based on the following formula: a(n) = 841*n - 1. The program should take an input value 'n' and output the corresponding value in the sequence. For example, if the input is 5, the program should output the 5th value in the sequence. | glaive | [
0.03681065887212753,
0.022408755496144295,
-0.02806652896106243,
-0.041227590292692184,
0.03696196898818016,
-0.030099157243967056,
-0.037469640374183655,
0.07607444375753403,
0.025557275861501694,
-0.026639055460691452,
0.025112828239798546,
0.03970963507890701,
-0.05107947811484337,
-0.0... | 0.823903 | 0.779239 | 0.044664 |
You are tasked with implementing an FFT convolution using the MatX library in C++. The goal is to perform a convolution in the time domain, and then compare the results with the output of performing the same operation in the frequency domain.
The process includes the following steps:
1. Create time domain buffers for... | glaive | [
0.01770537532866001,
0.025902004912495613,
-0.013067588210105896,
-0.04540621489286423,
0.048730574548244476,
-0.0077133746817708015,
-0.004074528813362122,
0.10406523942947388,
0.04618215188384056,
-0.007400932721793652,
0.024433959275484085,
0.03008825145661831,
-0.02544805034995079,
-0.... | 0.790926 | 0.771676 | 0.01925 |
I am working with a database table called numbers_mt, which contains a column called "number". I need to write a SQL query that retrieves specific information from this table based on certain conditions.
Specifically, I need to retrieve the maximum number from the "number" column for each group of numbers calculated ... | glaive | [
0.062058910727500916,
0.024145692586898804,
-0.04785774648189545,
-0.02429422363638878,
0.03335407003760338,
-0.05182555690407753,
-0.03728758916258812,
0.040733713656663895,
0.039971671998500824,
-0.012954297475516796,
0.020332837477326393,
0.027674172073602676,
-0.03994783014059067,
0.00... | 0.782556 | 0.765947 | 0.016609 |
You are tasked with creating a program that generates a sequence of numbers based on a specific algorithm. The sequence should be interleaved between two other sequences, A007583 and A000012. The algorithm to generate the sequence is as follows:
1. Start with the number 1.
2. Calculate the greatest common divisor (gcd)... | glaive | [
0.016636919230222702,
0.029735814779996872,
0.0010376442223787308,
-0.0439642034471035,
0.030916983261704445,
-0.012060685083270073,
-0.04021254926919937,
0.07636820524930954,
0.022828908637166023,
-0.036676499992609024,
0.03211633488535881,
0.02602810598909855,
-0.043681904673576355,
0.01... | 0.821297 | 0.779527 | 0.04177 |
You are tasked with creating a program that defines a struct and an enum, and initializes a constant struct and a list of enums in the C++ programming language. Your program should also include namespaces to organize the code.
Define a struct named Struct with two fields: an integer named first and a string named seco... | glaive | [
0.012201029807329178,
0.0061020213179290295,
-0.03629758581519127,
-0.021374203264713287,
0.04071425646543503,
-0.02680613286793232,
-0.028127161785960197,
0.09456648677587509,
0.028962308540940285,
-0.033711027354002,
0.024170948192477226,
0.041740573942661285,
-0.020120738074183464,
-0.0... | 0.795691 | 0.777863 | 0.017828 |
You are tasked with implementing a program that calculates the probability distribution for a quantum system with 16 qubits. The probability distribution is determined by the amplitudes of the system, which are given by the function amplitude(x, y). The goal is to find the maximum probability and the corresponding valu... | glaive | [
0.00458713760599494,
0.018704935908317566,
-0.032710738480091095,
-0.012569914571940899,
0.05286061391234398,
-0.023569269105792046,
-0.022867972031235695,
0.06778836250305176,
0.04215550795197487,
0.0023089642636477947,
0.02506728656589985,
0.03840715438127518,
-0.010271710343658924,
-0.0... | 0.798496 | 0.767419 | 0.031076 |
You are tasked with creating a program to calculate the maximum probability of a quantum state, given a set of quantum amplitudes. The program should also include visualizations of the probability distribution in both 3D and contour plot formats. The program should use the `amplitude` and `probability` functions provid... | glaive | [
0.0043234312906861305,
0.03081023320555687,
-0.027756912633776665,
-0.023682020604610443,
0.04361259192228317,
-0.018404986709356308,
-0.02152238041162491,
0.07107769697904587,
0.034513019025325775,
-0.0006719111697748303,
0.02700651064515114,
0.035030946135520935,
-0.013604829087853432,
-... | 0.79902 | 0.773599 | 0.025421 |
:
You are tasked with implementing a shader function that calculates the shadow factor for a given pixel in a 3D scene. The function must take into account the depth of the pixel in relation to the shadow map and apply Percentage Closer Filtering (PCF) to smooth out the shadows. The input variables include the shadow m... | glaive | [
0.013364194892346859,
0.030835632234811783,
-0.03738464415073395,
-0.04041485860943794,
0.04610954225063324,
-0.043965209275484085,
-0.012537134811282158,
0.07477586716413498,
0.036621466279029846,
-0.005125555209815502,
0.04437699913978577,
0.018898289650678635,
-0.02851196750998497,
0.00... | 0.783481 | 0.768155 | 0.015326 |
You are tasked with implementing a subroutine in Fortran called PXN. The subroutine is responsible for calculating 3x3 principal values. The subroutine takes in various input parameters such as RETMIN (boolean), PARTYP (character), LENARY (integer), NELBLK (integer), IXELB (array of integers), ISEVOK (array of booleans... | glaive | [
0.013335810042917728,
0.025110220536589622,
-0.0219779871404171,
-0.03695328161120415,
0.02545519918203354,
-0.01990584284067154,
0.004429430700838566,
0.05037737265229225,
0.02348603494465351,
0.0048803165555000305,
0.019097408279776573,
0.05097710341215134,
-0.03565118461847305,
-0.00799... | 0.805192 | 0.775147 | 0.030044 |
You are tasked with implementing a function that returns the number of possible values for an integer type in a programming language. The function should take the type of the integer as a parameter and calculate the range of possible values for that type, including both positive and negative values. The function should... | glaive | [
0.018233679234981537,
0.01376416441053152,
-0.038830921053886414,
-0.01668388769030571,
0.04996059089899063,
-0.033151596784591675,
-0.03232426568865776,
0.06182996928691864,
0.04720856249332428,
-0.022284269332885742,
0.03291869908571243,
0.07101963460445404,
-0.017649872228503227,
-0.022... | 0.809124 | 0.776636 | 0.032487 |
You are tasked with creating a program to calculate the probability distribution for a quantum state described by a specific amplitude function. The amplitude of the state is given by the function amplitude[x_,y_], and the probability of measuring the state in a certain configuration is given by the function probabilit... | glaive | [
-0.00019342519226484,
0.03555033728480339,
-0.028579454869031906,
-0.02354327216744423,
0.041961874812841415,
-0.026249615475535393,
-0.02068750374019146,
0.07908432930707932,
0.023833518847823143,
0.0078232167288661,
0.023589160293340683,
0.024883415549993515,
-0.022589026018977165,
-0.01... | 0.803458 | 0.770029 | 0.033429 |
I want to create a program that can perform the LU decomposition of a given matrix. The LU decomposition of a matrix A is a factorization of A into the product of a lower triangular matrix L and an upper triangular matrix U. The program should be able to take a matrix A as input and return the L and U matrices as outpu... | glaive | [
0.010182100348174572,
0.03515000641345978,
-0.030531905591487885,
-0.04363599419593811,
0.03667467087507248,
-0.006662230473011732,
-0.025778328999876976,
0.0693153515458107,
0.033807579427957535,
-0.022065557539463043,
0.028219232335686684,
0.03807789087295532,
-0.019158339127898216,
-0.0... | 0.79066 | 0.775564 | 0.015096 |
You are tasked with creating a program that computes the final score of a game based on certain input data. The game involves two parts: the first part computes the final score of the game, while the second part computes the final score of a recursive game.
Your task is to write a function or method that takes the inp... | glaive | [
0.017503226175904274,
0.02217402309179306,
-0.045950062572956085,
-0.03767716512084007,
0.045887548476457596,
-0.03251884505152702,
-0.028399359434843063,
0.057812537997961044,
0.04146714136004448,
-0.020064057782292366,
0.026019461452960968,
0.035377442836761475,
-0.01487209927290678,
-0.... | 0.807078 | 0.775456 | 0.031622 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.