Found 33676 Articles for Programming

Generate a Pseudo Vandermonde matrix of the Laguerre polynomial and x, y complex array of points in Python

AmitDiwan
Updated on 03-Mar-2022 05:18:59

137 Views

To generate a pseudo Vandermonde matrix of the Laguerre polynomial, use the laguerre.lagvander2d() in Python Numpy. The method returns the pseudo-Vandermonde matrix. The shape of the returned matrix is x.shape + (deg + 1, ), where The last index is the degree of the corresponding Laguerre polynomial. The dtype will be the same as the converted x.The parameter, x, y returns an Array of points. The dtype is converted to float64 or complex128 depending on whether any of the elements are complex. If x is scalar it is converted to a 1-D array. The parameter, deg is a list of ... Read More

Differentiate a Hermite series, set the derivatives and multiply each differentiation by a scalar in Python

AmitDiwan
Updated on 03-Mar-2022 04:58:56

174 Views

To differentiate a Hermite series, use the hermite.hermder() method in Python. The 1st parameter, c is an array of Hermite series coefficients. If c is multidimensional the different axis correspond to different variables with the degree in each axis given by the corresponding index.The 2nd parameter, m is the number of derivatives taken, must be non-negative. (Default: 1). The 3rd parameter, scl is a scalar. Each differentiation is multiplied by scl. The end result is multiplication by scl**m. This is for use in a linear change of variable. (Default: 1). The 4th parameter, axis is an Axis over which the ... Read More

Differentiate a Hermite series with multidimensional coefficients over axis 1 in Python

AmitDiwan
Updated on 03-Mar-2022 04:56:54

167 Views

To differentiate a Hermite series, use the hermite.hermder() method in Python. The 1st parameter, c is an array of Hermite series coefficients. If c is multidimensional the different axis correspond to different variables with the degree in each axis given by the corresponding index. The 2nd parameter, m is the number of derivatives taken, must be non-negative. (Default: 1)The 3rd parameter, scl is a scalar. Each differentiation is multiplied by scl. The end result is multiplication by scl**m. This is for use in a linear change of variable. (Default: 1). The 4th parameter, axis is an Axis over which the ... Read More

Differentiate a Hermite series with multidimensional coefficients over specific axis in Python

AmitDiwan
Updated on 03-Mar-2022 04:54:47

141 Views

To differentiate a Hermite series, use the hermite.hermder() method in Python. The 1st parameter, c is an array of Hermite series coefficients. If c is multidimensional the different axis correspond to different variables with the degree in each axis given by the corresponding index.The 2nd parameter, m is the number of derivatives taken, must be non-negative. (Default: 1). The 3rd parameter, scl is a scalar. Each differentiation is multiplied by scl. The end result is multiplication by scl**m. This is for use in a linear change of variable. (Default: 1). The 4th parameter, axis is an Axis over which the ... Read More

Integrate a Laguerre series and set the Integration constant in Python

AmitDiwan
Updated on 03-Mar-2022 04:52:40

171 Views

To integrate a Laguerre series, use the laguerre.lagint() method in Python. The method returns the Laguerre series coefficients c integrated m times from lbnd along axis. At each iteration the resulting series is multiplied by scl and an integration constant, k, is added. The scaling factor is for use in a linear change of variable.The 1st parameter, c is an array of Laguerre series coefficients. If c is multidimensional the different axis correspond to different variables with the degree in each axis given by the corresponding index. The 2nd parameter, m is an order of integration, must be positive. (Default: ... Read More

Integrate a Laguerre series and set the order of integration in Python

AmitDiwan
Updated on 03-Mar-2022 04:50:20

177 Views

To integrate a Laguerre series, use the laguerre.lagint() method in Python. The method returns the Laguerre series coefficients c integrated m times from lbnd along axis. At each iteration the resulting series is multiplied by scl and an integration constant, k, is added. The scaling factor is for use in a linear change of variable.The 1st parameter, c is an array of Laguerre series coefficients. If c is multidimensional the different axis correspond to different variables with the degree in each axis given by the corresponding index. The 2nd parameter, m is an order of integration, must be positive. (Default: ... Read More

C++ program to find minimum number of locations to place bombs to kill all monsters

Arnab Chakraborty
Updated on 02-Mar-2022 12:26:48

317 Views

Suppose we have two arrays X and H. Both are with N elements, also have another two numbers D and A. Consider in a story, a silver fox is fighting with N monsters. The monsters are standing in a row, coordinate of ith monster is X[i], and its health is H[i]. Silver fox can use bombs to attack monsters. Dropping bomb at location x will damage all monsters within the range of x - D to x + D. Their health will be reduced by A. When all monsters have 0 health left, then the fox wins. We have to ... Read More

C++ program to count maximum possible division can be made in a graph with given condition

Arnab Chakraborty
Updated on 02-Mar-2022 12:21:17

168 Views

Suppose we have an adjacency matrix of a graph G. We have to check whether we can divide the vertices into non-empty sets V1, ... Vk, such that: every edge connects two vertices belonging to two adjacent sets. If the answer is yes, we have to find the maximum possible value of sets k, in such division.So, if the input is like010110101001010100101000100000010000then the output will be 4StepsTo solve this, we will follow these steps −Define an array dp of size: 210. n := size of matrix fl := 1 ans := 0 for initialize i := 0, when i < ... Read More

C++ program to find at least how much score it needs to get G amount of score

Arnab Chakraborty
Updated on 02-Mar-2022 12:24:07

306 Views

Suppose we have two arrays p and c both are with D number of elements each, and another number G. Consider in a coding contest, each problem has its score based on difficulty. The problem p[i] has score 100i. These p[1] + ... + p[D] problems are all of the problems present in the contest. a user in the coding site has a number total_score. The total_score of an user is the sum of the following two elements.Base score: the sum of score of all solved problemsBonus: when a user solves all problems with a score of 100i, he or ... Read More

C++ Program to find maximum possible smallest time gap between two pair of clock readings

Arnab Chakraborty
Updated on 02-Mar-2022 11:27:24

190 Views

Suppose we have an array D with N elements. Consider in a code festival there are N+1 participants including Amal. Amal checked and found that the time gap between the local times in his city and the i-th person's city was D[i] hours. The time gap between two cities: For any two cities A and B, if the local time in city B is d o'clock at the moment when the local time in city A is 0 o'clock, then the time gap between these two cities is minimum of d and 24−d hours.Here, we are using 24-hour notation. Then, ... Read More

Advertisements