Questions tagged [simplification]

249 questions
0
votes
1 answer

Restore order of polygons after CGAL::Polyline_simplification_2

I follow this example of the CGAL documentation in order to simplify a number of polygons, which are initially stored in a vector called polys. Afterwards I collect the simplified polygons into a vector called simple_polys. However, the order of the…
TMueller83
  • 412
  • 3
  • 11
0
votes
1 answer

Convert sympy to numpy

I have two NumPy array (two variables), which contains complex numbers. Since they have been defined in NumPy, so the complex notation is denoted by "j". for i in range(0, 8): cg1 = np.array(eigVal1[i]) det_eval = eval(det) AA = det_eval[0:2,0:2] bb…
0
votes
1 answer

is there a way to avoid using this function twice?

void inputData(){ printf("Enter contact name : "); gets(temp.name); fflush(stdin); printf("Enter contact email : "); gets(temp.email); fflush(stdin); printf("Enter contact phone number : ");…
0
votes
0 answers

How to filter and smooth the curve into straight line

enter image description here In this first picture, the line represents the velocity change during the taking off period of the plane. I want to smooth this curve and replace it with straight lines and then to identify the trend of every…
Q F
  • 1
  • 1
0
votes
0 answers

Simplification in Maxima

I have defined the following expression: r:sqrt((y1-x1)^2+(y2-x2)^2); When I differentiate r with respect to y1, i.e. diff(r,y1); I get the answer as (y1-x1)/sqrt((y1-x1)^2+(y2-x2)^2); The answer is technically correct but I would like the answer to…
0
votes
0 answers

simplifying long expressions in sympy?

I'm doing some mathematical modelling and couldn't simplify the following expression result into its simplified form like this I'm new with sympy and already tried the combinations of simplify, expand, cancel, collect methods... but nothing…
Jack
  • 11
  • 1
0
votes
1 answer

What practical algorithms exist for simplifying sampled multidimensional curves

For 2-dimensional sampled curves (an array of 2D points) there exists the Rahmer-Douglas-Peucker algorithm which only keeps "important" points. It works by calculating the perpendicular distance of each point (or sample) to a line that connects the…
exocortex
  • 375
  • 2
  • 9
0
votes
0 answers

why CGAL mesh simplification takes so long

I try to use triangulated surface mesh simplification of cgal. I used Garland&Heckbert Simplification to simplify my mesh, but it tooks so long. My data has 50000 nv, 165883 ne and 109521 nf, which needs almost 30mins with 0.2 stop_ratio. Is the…
0
votes
1 answer

RuntimeError: Sizes of tensors must match except in dimension 2. Expected size 32 but got size 1 for tensor number 3 in the list

I am running EDITNTS: https://github.com/yuedongP/EditNTS without teacher forcing on some training data. When I run main.py I get the error: File "/home/jba5337/work/ds440w/EditNTS-Google/editnts.py", line 252, in forward output_t =…
0
votes
1 answer

This says its having two 2bit inputs so how to find the truth table

Question 2 A logic circuit is given two 2-bit binary numbers A and B as its inputs. The circuit consists of two outputs Y1 and Y2. The output values of YI and Y2 are obtained as follows: If A
0
votes
3 answers

Javascript ,simplifying a method

I am coding a utility app for chess and I have some repetitive code pattern that keeps repeating across different methods. Basically, I am tracking the color of the user {white, black}. If the user is white then the moves they do follow the pattern…
hexaquark
  • 883
  • 4
  • 16
0
votes
1 answer

Comparing list to list ignoring case in both of them Python 3.7 simplification

I'm learning python as my first language, and I'm working with Python crash course as my first book. In try it yourself 5-10 section there is a task to create two lists and compare the second one to the first using for loop, to check whether or not…
0
votes
4 answers

How to simplify long if/elif statement when using comparison

I am trying to simplify this: if num < 9: y = 1 elif num < 17: y = 2 elif num < 25: y = 3 elif num < 33: y = 4 elif num < 41: y = 5 elif num < 49: y = 6 elif num < 57: y = 7 else: y = 8 I haven't found a way to do…
0
votes
1 answer

Show individual content with jquery - simplify code?

In a tab gallery as described here I have added individual title above and content under the expanded images with the following code, which I am sure can be simplified (going with the DRY rule :-) ), right? The aim is in one sentence: When I click…
ISB
  • 25
  • 3
0
votes
1 answer

extract and format data from dataset into matrix in R

I want to make this dataframe into this matrix I have tried: x <- read.csv("sample1.csv") ax <-…
Dark Star
  • 15
  • 4