TransWikia.com

Reading product of same ByteArrays

Mathematica Asked by apt45 on January 27, 2021

I am handling a huge set of data and I am trying to optimize my code. I have very large expressions to expand and simplify and I’ve seen that converting the expressions to ByteArrays improves a lot the time spent by Mathematica to expand and simplify.

However, I have the following problem. I want to convert the following expressions

expr = BinarySerialize[2] BinarySerialize[2]
expr2 = BinarySerialize[3] BinarySerialize[2]

To do that, I run the following commands

BinaryDeserialize /@ expr
BinaryDeserialize /@ expr2

In the first case, I get the error BinaryDeserialize: 2 is not a valid ByteArray, while the second case works perfectly. This is because expr automatically takes the form of Power[a_,b_]. How can I overcome this difficulty in a smart way?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP